Passed
Pull Request — main (#221)
by
unknown
04:24
created

pocketutils.misc.colored_notifications   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 45
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 13

12 Functions

Rating   Name   Duplication   Size   Complexity  
A notify_user() 0 4 1
A notify_light_thin() 0 2 1
A success_to_user_thin() 0 2 1
A notify_user_light() 0 4 1
A print_to_user() 0 9 2
A concern_to_user_thin() 0 2 1
A warn_user() 0 4 1
A warn_thin() 0 2 1
A concern_to_user() 0 4 1
A notify_thin() 0 2 1
A header_to_user() 0 2 1
A success_to_user() 0 4 1
1
from typing import Iterable
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
3
from pocketutils.misc.klgists import logger
4
from colorama import Fore, Style
0 ignored issues
show
introduced by
Unable to import 'colorama'
Loading history...
5
6
def warn_user(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
7
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
8
	warn_thin(*lines)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
9
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
10
def warn_thin(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
11
	print_to_user(['', *lines, ''], Fore.RED)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
12
13
def notify_user(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
14
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
15
	notify_thin(*lines)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
16
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
17
def notify_thin(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
18
	print_to_user(['', *lines, ''], Fore.BLUE)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
19
20
def success_to_user(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
21
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
22
	success_to_user_thin(*lines)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
23
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
24
def success_to_user_thin(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
25
	print_to_user(['', *lines, ''], Fore.GREEN)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
26
27
def concern_to_user(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
28
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
29
	concern_to_user_thin(*lines)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
30
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
31
def concern_to_user_thin(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
32
	print_to_user(['', *lines, ''], Fore.MAGENTA)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
33
34
def notify_user_light(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
35
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
36
	notify_light_thin(*lines)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
37
	print()
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
38
def notify_light_thin(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
39
	print_to_user(['', *lines, ''], Style.BRIGHT, sides='')
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
40
41
def header_to_user(*lines: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
42
	print_to_user(lines, Style.BRIGHT)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
43
44
def print_to_user(lines: Iterable[str], color: int, top: str='_', bottom: str='_', sides: str='', line_length: int=100):
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (120/100).

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

Loading history...
Coding Style introduced by
Exactly one space required around keyword argument assignment
Loading history...
introduced by
Missing function or method docstring
Loading history...
best-practice introduced by
Too many arguments (6/5)
Loading history...
45
	def cl(text: str): print(str(color) + sides + text.center(line_length - 2*len(sides)) + sides)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
Coding Style Naming introduced by
Function name "cl" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
More than one statement on a single line
Loading history...
46
	print(str(color) + top * line_length)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
47
	logger.debug(top * line_length)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
48
	for line in lines:
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
49
		logger.debug(line)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
50
		cl(line)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
51
	print(str(color) + bottom * line_length)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
52
	logger.debug(bottom * line_length)
0 ignored issues
show
Coding Style introduced by
Found indentation with tabs instead of spaces
Loading history...
53
0 ignored issues
show
coding-style introduced by
Trailing newlines
Loading history...
54