Showing 15 of 36 total issues
Function compile
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def compile(self):
"""
Uses the FileBlock to produce an action.
The type of action produced depends on the value of the block's
'action' attribute.
- Read upRead up
- Create a ticketCreate a ticket
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 process_token
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def process_token(token_str, shlexer):
tokenizing_ctx = ExecutionContext()['tokenizing']
def _reject_unexpected(reject_start=False, reject_end=False):
def _reject():
- Read upRead up
- Create a ticketCreate a ticket
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 set_default_subparser
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_default_subparser(parser, name):
"""
Default subparser selection. Call after setup, just before parse_args()
"""
subparser_found = False
- Read upRead up
- Create a ticketCreate a ticket
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 11 (exceeds 5 allowed). Consider refactoring. Open
def execute(self, filesys):
"""
DirChmodAction execution.
Change the umask of a directory or directory tree.
- Read upRead up
- Create a ticketCreate a ticket
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 gen_handler
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def gen_handler(filename=None, stream=None):
"""
Generate a log handler for either a file or a stream. If both are
specified, only use the filename. If neither is specified, use stderr.
- Read upRead up
- Create a ticketCreate a ticket
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_action
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def copy_action(self):
"""
Copy a directory. This may be all or part of the action produced
by the block upon action conversion.
"""
- Read upRead up
- Create a ticketCreate a ticket
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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, target, user, group, file_context,
- Create a ticketCreate a ticket
Function chown
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def chown(self, path, uid, gid, *args, **kwargs): # pragma: no cover
- Create a ticketCreate a ticket
Function apply_to_block
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_to_block(self, block):
"""
Given a @block produced by the parser, takes any settings which
describe defaults and uses them to populate any missing attrs
of the block.
- Read upRead up
- Create a ticketCreate a ticket
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 expand_blocks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def expand_blocks(self, root_dir, v3_relpaths, ancestors=None):
"""
Expands a manifest block by reading its source, parsing it into
blocks, and assigning those to be the sub_blocks of the manifest
block, forming a block tree. This is, in a certain sense, part
- Read upRead up
- Create a ticketCreate a ticket
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 _apply_environment_overrides
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _apply_environment_overrides(self):
# Grab all of the mappings from the environment that
# start with the SALVE prefix and are uppercase
# prevents XYz=a and XYZ=b from being ambiguous
salve_env = dict((k, self.env[k]) for k in self.env
- Read upRead up
- Create a ticketCreate a ticket
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 handle_token_noblock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def handle_token_noblock(token):
"""
Handler for parsing a token outside of a block context. (i.e. not in curly
braces)
- Read upRead up
- Create a ticketCreate a ticket
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 load_args
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_args():
"""
Generates a parser, reads commandline arguments, and then does basic
post-processing of arguments whose meanings and effects are either general
across subcommands or which have effects related to argument parsing (like
- Read upRead up
- Create a ticketCreate a ticket
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 mkdir
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mkdir(self, path, recursive=True):
"""
Use os.mkdir or os.makedirs to create the directory desired,
suppressing "already exists" errors.
May still return OSError(2, 'No such file or directory') when
- Read upRead up
- Create a ticketCreate a ticket
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 expand_file_paths
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def expand_file_paths(self, root_dir):
"""
Expands all relative paths in a block's set of attribute values,
given a directory to act as the prefix to all of the paths. The
attributes are identified as paths based on the block type.
- Read upRead up
- Create a ticketCreate a ticket
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"