<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _detect(self):
 """ Detect unused state variables """

        results = []
        for c in self.slither.contracts_derived:
            unusedVars = self.detect_unused(c)
            if unusedVars:
                info = ''
                for var in unusedVars:
                    info += "{}.{} ({}) is never used in {}\n".format(var.contract.name,
                                                                      var.name,
                                                                      var.source_mapping_str,
                                                                      c.name)


                json = self.generate_json_result(info)
                self.add_variables_to_json(unusedVars, json)
                results.append(json)

        return results