code: def _detect(self):
          
          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
docs: Detect unused state variables