Showing 63 of 71 total issues
Function copyfile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def copyfile(src, dest, symlink=True):
if not os.path.exists(src):
# Some bad symlink in the src
logger.warn('Cannot find file %s (bad symlink)', src)
return
- 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 install_pip
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def install_pip(py_executable, search_dirs=None, never_download=False):
if search_dirs is None:
search_dirs = file_search_dirs()
filenames = []
- 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 call_subprocess
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def call_subprocess(cmd, show_stdout=True,
Function call_subprocess
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def call_subprocess(cmd, show_stdout=True,
Function resolve_interpreter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resolve_interpreter(exe):
"""
If the executable given isn't an absolute path, search $PATH for the interpreter
"""
if os.path.abspath(exe) != exe:
- 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 install_activate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def install_activate(home_dir, bin_dir, prompt=None):
if sys.platform == 'win32' or is_jython and os._name == 'nt':
files = {'activate.bat': ACTIVATE_BAT,
'deactivate.bat': DEACTIVATE_BAT}
if os.environ.get('OS') == 'Windows_NT' and os.environ.get('OSTYPE') == 'cygwin':
- 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 install_python
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
Function resolve_interpreter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resolve_interpreter(exe):
"""
If the executable given isn't an absolute path, search $PATH for the interpreter
"""
if os.path.abspath(exe) != exe:
- 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 install_python
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
Function install_activate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def install_activate(home_dir, bin_dir, prompt=None):
if sys.platform == 'win32' or is_jython and os._name == 'nt':
files = {'activate.bat': ACTIVATE_BAT,
'deactivate.bat': DEACTIVATE_BAT}
if os.environ.get('OS') == 'Windows_NT' and os.environ.get('OSTYPE') == 'cygwin':
- 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 writefile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def writefile(dest, content, overwrite=True):
if not os.path.exists(dest):
logger.info('Writing %s', dest)
f = open(dest, 'wb')
f.write(content.encode('utf-8'))
- 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 writefile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def writefile(dest, content, overwrite=True):
if not os.path.exists(dest):
logger.info('Writing %s', dest)
f = open(dest, 'wb')
f.write(content.encode('utf-8'))
- 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
Method render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.render(source, target, ctx = {})
target = File.expand_path(target)
Dir.chdir(source) do
Dir['**/*'].each do |name|
- 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
Consider simplifying this complex logical expression. Open
if not for_tables:
string_to_sign += (request.get_header('If-modified-since') or '') + NEW_LINE
string_to_sign += (request.get_header('If-match') or '') + NEW_LINE
string_to_sign += (request.get_header('If-none-match') or '') + NEW_LINE
string_to_sign += (request.get_header('If-unmodified-since') or '') + NEW_LINE
Consider simplifying this complex logical expression. Open
if not for_tables:
string_to_sign += (request.get_header('If-modified-since') or '') + NEW_LINE
string_to_sign += (request.get_header('If-match') or '') + NEW_LINE
string_to_sign += (request.get_header('If-none-match') or '') + NEW_LINE
string_to_sign += (request.get_header('If-unmodified-since') or '') + NEW_LINE
Function _install_req
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _install_req(py_executable, unzip=False, distribute=False,
Function put_blob
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def put_blob(self, container_name, blob_name, data, content_type = "", metadata = {}):
Function _install_req
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _install_req(py_executable, unzip=False, distribute=False,
Function put_blob
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def put_blob(self, container_name, blob_name, data, content_type = "", metadata = {}):
Function level_matches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def level_matches(self, level, consumer_level):
"""
>>> l = Logger([])
>>> l.level_matches(3, 4)
False
- 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"