Showing 13 of 13 total issues
Function install_updates
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def install_updates(self) -> None:
"""Install requirements updates"""
for updated_file in self.updated_files:
if updated_file in REQUIREMENTS_FILES:
command = ['pip', 'install', '-r', updated_file]
- 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 write_dependency_update_lines
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def write_dependency_update_lines(
self, dependency: str, version: str, lines: list[str], file_type: str,
) -> bool:
"""
Given a dependency and some lines, update the lines. Return a
- 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 main
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def main(self) -> bool:
"""
Update all dependencies
Return if updates were made
"""
- 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 find_updated_version
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def find_updated_version(self, dependency: str, original_version: str) -> str:
if original_version == 'latest':
self.util.warn('Cannot update docker image when using "latest"')
return ''
if dependency.count('/') == 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 update_submodule
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_submodule(self, submodule: Submodule) -> Optional[str]:
if not submodule.remote_tag and not submodule.remote_commit:
return None
version = ''
if submodule.remote_tag and submodule.remote_commit:
- 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 execute_shell
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def execute_shell(
self,
command: list[str],
readonly: bool,
cwd: Optional[Path] = 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 execute_shell
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_shell(
Function check_applicable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_applicable(self) -> bool:
# Make sure pip is recent enough
command = ['pip', '--version']
try:
result = self.util.execute_shell(
- 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
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
Function compare_versions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compare_versions(self, current: str, proposed: str) -> bool:
"""
Take the current version and a proposed new version and return a bool
for whether the new version is a valid upgrade. The new version is a
valid upgrade if the version structure matches and the version numbers
- 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 write_dependency_update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_dependency_update(self, dependency: str, version: str) -> bool:
"""Given a dependency, update it to a given version"""
updated = False
for reqfile in REQUIREMENTS_FILES:
with Python.edit_requirements(reqfile, self.util.dry_run) as lines:
- 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 update_dependencies
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_dependencies(self) -> bool:
submodules = self.get_submodule_info()
clean = True
for submodule in submodules:
self.util.log('Checking dependency: %s' % submodule.path)
- 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"