Failed Conditions
Pull Request — master (#1625)
by Abdeali
01:46
created

coalib.tests.test_bears.LineCountTestBear.run()   A

Complexity

Conditions 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 9
rs 9.6666
1
from coalib.bears.LocalBear import LocalBear
2
from coalib.results.Result import Result
3
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
4
5
6
class LineCountTestBear(LocalBear):
7
8
    def run(self, filename, file):
9
        '''
10
        Counts the lines of each file.
11
        '''
12
        yield Result.from_values(
13
            origin=self,
14
            message="This file has {count} lines.".format(count=len(file)),
15
            severity=RESULT_SEVERITY.INFO,
16
            file=filename)
17