Completed
Pull Request — master (#1116)
by Lasse
01:41
created

bears.general.LineCountBear   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %
Metric Value
dl 0
loc 10
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_SEVERITY import RESULT_SEVERITY
3
from coalib.results.Result import Result
4
5
6
class LineCountBear(LocalBear):
7
    def run(self, filename, file, *args):
8
        '''
9
        Counts the lines of each file.
10
        '''
11
        yield Result.from_values(
12
            origin=self,
13
            message="This file has {count} lines.".format(count=len(file)),
14
            severity=RESULT_SEVERITY.INFO,
15
            file=filename)
16