Showing 7 of 46 total issues
Function generate_header_files
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def generate_header_files(self):
for filename in self.pyx_files:
path, name, cmod_name_path, module_name, coded_module_name, complete_module_name = self.transform_module_name(filename)
if not name.endswith('.pyx'):
continue
- 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 parallelCCompile
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0,
Function __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, extension_name: str, files: tp.Iterator[str],
dont_snakehouse: bool = False,
**kwargs):
# sanitize path separators so that Linux-style paths are supported on Windows
logger.warning('Building extension %s with files %s', extension_name, files)
- 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 cull_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cull_path(path):
if not path:
return path
if path[0] == os.path.sep:
if len(path) > 1:
- 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 build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build(extensions: tp.List[MultiBuildType], *args, nthreads=None, **kwargs):
if nthreads is None:
nthreads = multiprocessing.cpu_count()
kwargs['nthreads'] = nthreads
returns = []
- 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 transform_module_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def transform_module_name(self, filename):
path, name = os.path.split(filename)
module_name = name.replace('.pyx', '')
if path.startswith(self.bootstrap_directory):
cmod_name_path = path[len(self.bootstrap_directory):]
- 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 monkey_patch_parallel_compilation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def monkey_patch_parallel_compilation(cores: tp.Optional[int] = None) -> None:
"""
This monkey-patches distutils to provide parallel compilation, even if you have
a single extension built from multiple .c files.
- 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"