1 | from coalib.bears.Bear import Bear |
||
2 | from coalib.bears.BEAR_KIND import BEAR_KIND |
||
3 | |||
4 | |||
5 | class GlobalBear(Bear): |
||
0 ignored issues
–
show
Unused Code
introduced
by
![]() |
|||
6 | """ |
||
7 | A GlobalBear is able to analyze semantic facts across several file. |
||
8 | |||
9 | The results of a GlobalBear will be presented grouped by the origin Bear. |
||
10 | Therefore Results spanning above multiple files are allowed and will be |
||
11 | handled right. |
||
12 | |||
13 | If you only look at one file at once anyway a LocalBear is better for your |
||
14 | needs. (And better for performance and usability for both user and |
||
15 | developer.) |
||
16 | """ |
||
17 | |||
18 | def __init__(self, |
||
19 | file_dict, # filename : file contents |
||
20 | section, |
||
21 | message_queue, |
||
22 | timeout=0): |
||
23 | Bear.__init__(self, section, message_queue, timeout) |
||
24 | self.file_dict = file_dict |
||
25 | |||
26 | @staticmethod |
||
27 | def kind(): |
||
28 | return BEAR_KIND.GLOBAL |
||
29 | |||
30 | def run(self, |
||
31 | *args, |
||
32 | dependency_results=None, |
||
33 | **kwargs): |
||
34 | """ |
||
35 | Handles all files in file_dict. |
||
36 | |||
37 | :return: A list of Result type. |
||
38 | """ |
||
39 | raise NotImplementedError( |
||
40 | "This function has to be implemented for a runnable bear.") |
||
41 |