bfd61fb7a0c4456ce812a227f3b1962b2c727879,bears/general/KeywordBear.py,KeywordBear,run,#KeywordBear#Any#Any#Any#,14

Before Change


        """
        results = list()

        for i in range(len(keywords)):
            keywords[i] = keywords[i].lower()

        for line_number, line in enumerate(file):
            for keyword in keywords:
                results += self.check_line_for_keyword(line.lower(),
                                                       filename,

After Change


            Usual examples are TODO and FIXME.
        """
        keywords_regex = re.compile(
            "(" + "|".join(re.escape(key) for key in keywords) + ")",
            re.IGNORECASE)

        for line_number, line in enumerate(file):
            for keyword in keywords_regex.finditer(line):
                yield Result.from_values(
                    origin=self,
                    message="The line contains the keyword "{}"."
                            .format(keyword.group()),
                    file=filename,
                    line=line_number + 1,
                    column=keyword.start() + 1,
                    end_line=line_number + 1,
                    end_column=keyword.end() + 1,
                    severity=RESULT_SEVERITY.INFO)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: coala/coala-bears
Commit Name: bfd61fb7a0c4456ce812a227f3b1962b2c727879
Time: 2016-09-03
Author: abdealikothari@gmail.com
File Name: bears/general/KeywordBear.py
Class Name: KeywordBear
Method Name: run


Project Name: PIQuIL/QuCumber
Commit Name: 6a9b9a282e8698f7a8c5d66c0e42851bd0c53d2b
Time: 2019-12-23
Author: emerali@users.noreply.github.com
File Name: tests/grads_utils.py
Class Name: ComplexGradsUtils
Method Name: transform_bases


Project Name: matplotlib/matplotlib
Commit Name: cbc060c8fe914bb3c75f42f3af4fc40b0eadba52
Time: 2018-02-25
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/artist.py
Class Name:
Method Name: setp


Project Name: coala/coala-bears
Commit Name: bfd61fb7a0c4456ce812a227f3b1962b2c727879
Time: 2016-09-03
Author: abdealikothari@gmail.com
File Name: bears/general/KeywordBear.py
Class Name: KeywordBear
Method Name: run