Failed Conditions
Pull Request — master (#1093)
by Lasse
01:45
created

bears.python.PyCommentedCodeBear   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %
Metric Value
dl 0
loc 12
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 2
1
import eradicate
2
3
from bears.linters.CorrectionBasedBear import CorrectionBasedBear
4
5
6
class PyCommentedCodeBear(CorrectionBasedBear):
7
    GET_REPLACEMENT = staticmethod(
8
        lambda file:
9
        (list(eradicate.filter_commented_out_code(''.join(file))), []))
10
    RESULT_MESSAGE = "This file contains commented out source code."
11
12
    def run(self, filename, file):
13
        """
14
        Detects commented out source code in Python.
15
        """
16
        for result in self.retrieve_results(filename, file):
17
            yield result
18