lighthouse_garden.utility.info   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 20
dl 0
loc 43
rs 10
c 0
b 0
f 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A print_header() 0 12 1
A print_footer() 0 9 2
A get_target_name() 0 10 2
1
#!/usr/bin/env python3
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
# -*- coding: future_fstrings -*-
3
4
from lighthouse_garden import info
5
from lighthouse_garden.utility import output, system
6
7
8
def print_header():
9
    """
10
    Printing console header
11
    :return:
12
    """
13
    print(f'{output.CliFormat.BLACK}#################################################{output.CliFormat.ENDC}')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (110/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
14
    print(f'{output.CliFormat.BLACK}#                                               #{output.CliFormat.ENDC}')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (110/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
15
    print(f'{output.CliFormat.BLACK}#{output.CliFormat.ENDC}               LIGHTHOUSE GARDEN               {output.CliFormat.BLACK}#{output.CliFormat.ENDC}')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (157/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
16
    print(f'{output.CliFormat.BLACK}#                    v{info.__version__}                     #{output.CliFormat.ENDC}')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (123/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
17
    print(f'{output.CliFormat.BLACK}# {info.__homepage__} #{output.CliFormat.ENDC}')
18
    print(f'{output.CliFormat.BLACK}#                                               #{output.CliFormat.ENDC}')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (110/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
19
    print(f'{output.CliFormat.BLACK}#################################################{output.CliFormat.ENDC}')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (110/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
20
21
22
def print_footer():
23
    """
24
    Printing console footer
25
    :return:
26
    """
27
    if 'errors' in system.config:
28
        output.println(f'{output.Subject.WARNING} Errors occurred during execution, see console output for more information')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (125/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
29
    else:
30
        output.println(f'{output.Subject.OK} Successfully fetched lighthouse data')
31
32
33
def get_target_name(target):
34
    """
35
    Get the pretty target name
36
    :param target: Dict
37
    :return:
38
    """
39
    _name = target['url']
40
    if 'title' in target:
41
        _name = f'{target["title"]} ({_name})'
42
    return _name
43