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

Before Change


            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,
                                                       line_number,
                                                       keyword)

        return results

    def check_line_for_keyword(self, line, filename, line_number, keyword):
        pos = line.find(keyword)

After Change


            A list of keywords to search for (case insensitive).
            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: 11

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: hellohaptik/chatbot_ner
Commit Name: e870ef14c590502fb0dc5ff3199e2602a87ec008
Time: 2019-03-18
Author: jain.chirag925@gmail.com
File Name: ner_v1/detectors/numeral/budget/budget_detection.py
Class Name: BudgetDetector
Method Name: _detect_max_budget


Project Name: hellohaptik/chatbot_ner
Commit Name: e870ef14c590502fb0dc5ff3199e2602a87ec008
Time: 2019-03-18
Author: jain.chirag925@gmail.com
File Name: ner_v1/detectors/numeral/budget/budget_detection.py
Class Name: BudgetDetector
Method Name: _detect_min_budget