Showing 11 of 11 total issues
File lib_get_include_options.py
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
# STDLIB
from typing import List, Tuple, Union
# OWN
import lib_log_utils
Function import_module_from_file
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def import_module_from_file(module_fullpath: Union[pathlib.Path, str], reload: bool = False): # type: ignore
"""
TODO : replace with lib_import when avail maybe take from pycharm
"""
module_fullpath = pathlib.Path(module_fullpath)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function rst_str_replace
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def rst_str_replace(source: Union[pathlib.Path, IO[str]], # str, file or sys.stdin
Function replace
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def replace(
Function cli_replace
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def cli_replace(
Function check_source_and_target
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_source_and_target(source: Union[pathlib.Path, IO[str]],
target: Union[pathlib.Path, IO[str], None],
in_place: bool) -> Tuple[Union[pathlib.Path, IO[str]], Union[pathlib.Path, IO[str], None]]:
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function include
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def include(source: str, target: str, quiet: bool, inplace: bool, source_encoding: str, target_encoding: str) -> None:
Function cli_include
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cli_include(source: str, target: str, quiet: bool, inplace: bool, source_encoding: str, target_encoding: str) -> None: # pragma: no cover
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function rst_inc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rst_inc(source: Union[pathlib.Path, IO[str]],
Function get_include_filename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_include_filename(block: Block) -> Tuple[pathlib.Path, pathlib.Path]:
"""
>>> block = lib_test.get_test_block_ok()
>>> # test include Filename OK
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"