LineCountTestBear   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
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
    LANGUAGES = {'all'}
9
10
    def run(self, filename, file):
11
        """
12
        Counts the lines of each file.
13
        """
14
        yield Result.from_values(
15
            origin=self,
16
            message="This file has {count} lines.".format(count=len(file)),
17
            severity=RESULT_SEVERITY.INFO,
18
            file=filename)
19