Failed Conditions
Pull Request — master (#1596)
by Abdeali
01:42
created

coalib.tests.coala_bears_test_module.LineCountTestBear   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %
Metric Value
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 9 1
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