Completed
Push — master ( 3c108b...266306 )
by Oleksandr
03:35
created

verboselib.cli.encoding   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A has_bom() 0 8 2
1
import codecs
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
3
from pathlib import Path
4
5
6
def has_bom(file_path: Path) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
7
  with file_path.open("rb") as f:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
Coding Style Naming introduced by
Variable name "f" 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...
8
    sample = f.read(4)
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
9
10
  return (
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
11
       sample[:3] == b"\xef\xbb\xbf"
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation (remove 1 space).
Loading history...
12
    or sample.startswith(codecs.BOM_UTF16_LE)
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation (add 2 spaces).
Loading history...
13
    or sample.startswith(codecs.BOM_UTF16_BE)
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation (add 2 spaces).
Loading history...
14
  )
15