fastest.file_handler.ignore_paths   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A is_path_to_be_ignored() 0 14 3
1
import fnmatch
2
3
4
def is_path_to_be_ignored(event_path, report_path, ignore_patterns):
5
    """
6
    answers: Is event_path one among the ignore_patterns?
7
    strips report path from the event_path
8
    :param event_path: str
9
    :param report_path: str
10
    :param ignore_patterns: list
11
    :return: bool
12
    """
13
    for ignored_pattern in ignore_patterns:
14
        _, current_file_path = event_path.split(report_path + '/')
15
        if fnmatch.fnmatch(current_file_path, ignored_pattern):
16
            return True
17
    return False
18