Showing 9 of 9 total issues
File pip2conda.py
has 549 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) Cardiff University (2022)
# SPDX-License-Identifier: GPL-3.0-or-later
"""Parse setup.cfg for package requirements and print out a list of
Function parse_all_requirements
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def parse_all_requirements(
project,
python_version=None,
extras=[],
requirements_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 parse_requirements_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_requirements_file(file, **kwargs):
"""Parse a requirements.txt-format file.
"""
if isinstance(file, (str, os.PathLike)):
with open(file, "r") as fileobj:
- 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 pip2conda
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def pip2conda(
Function find_packages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_packages(requirements, use_mamba=True):
"""Run conda/mamba to resolve an environment
This does not actually create an environment, but is called so
that if it fails because packages are missing, they can be
- 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 parse_all_requirements
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_all_requirements(
Function parse_requirements
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_requirements(
Function parse_requirements
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_requirements(
requirements,
conda_forge_map=dict(),
environment=None,
extras=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 _evaluate_marker
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _evaluate_marker(marker, environment=None, extras=None):
"""Evaluate whether an environment marker matches this environment.
"""
if not marker: # no marker, always True
return True
- 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"