graphite-project / carbon

Unused variable found PYL-W0612
Anti-pattern
Major
8 months ago4 years old
Unused variable 'port'
 87    self.ring.add_node((server, instance))
 88
 89  def removeDestination(self, destination):
 90    (server, port, instance) = destination 91    if not self.hasDestination(destination):
 92      raise Exception("destination instance (%s, %s) not configured" % (server, instance))
 93    del self.instance_ports[(server, instance)]
Unused variable 'plugin_name'
 41        pass
 42    fake_service = _FakeService()
 43
 44    for plugin_name, plugin_class in MetricReceiver.plugins.items(): 45      plugin_class.build(fake_service)
 46
 47
Unused variable 'value'
 38    self.aggregation_func = None
 39
 40  def input(self, datapoint):
 41    (timestamp, value) = datapoint 42    interval = timestamp - (timestamp % self.aggregation_frequency)
 43    if interval in self.interval_buffers:
 44      buffer = self.interval_buffers[interval]
Unused variable 'DummyProcessor'
 6
 7class ProcessorTest(TestCase):
 8  def test_processor_registers(self):
 9    class DummyProcessor(Processor):10      plugin_name = "dummy_processor"
11
12    self.assertTrue("dummy_processor" in Processor.plugins)
Unused variable 'options'
 77        options.
 78        """
 79        parser = FakeParser()
 80        options, args = parser.parse_args(("start",)) 81        self.assertEqual(("start",), args)
 82
 83