Showing 4 of 6 total issues
File overthere.py
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
#
# Copyright 2019 XEBIALABS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Function delete_from
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def delete_from(self, source, target, target_dir_shared=False):
"""
Uses the source directory to determine the files to delete from the target directory.
Only the immediate sub-directories and files in the source directory base are used.
If the target is a file, then it is deleted without analysing the source.
- 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 copy_to
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def copy_to(self, source, target, mkdirs=True):
"""
Copy the source file to the target file
:param source: com.xebialabs.overthere.OverthereFile
:param target: com.xebialabs.overthere.OverthereFile
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def execute(self, cmd, check_success=True, suppress_streaming_output=False):
"""
Executes the command on the remote system and returns the result
:param cmd: Command line as an Array of Strings or String. A String is split by space.
:param check_success: checks the return code is 0. On failure the output is printed to stdout and a system exit is performed
- 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"