Showing 2,859 of 2,859 total issues
Avoid deeply nested control flow statements. Open
Open
if(options.verbose>0):
print "Removing %s because tree %s is empty." % (thePool, tree)
remove.add(thePool)
Avoid deeply nested control flow statements. Open
Open
while desc_str.endswith('>'):
start_tag_index = desc_str.rfind('<')
if start_tag_index < 0:
break
desc_str = desc_str[:start_tag_index].rstrip()
Avoid deeply nested control flow statements. Open
Open
if (not jsdoc.HasFlag('private') and
not ('underscore' in jsdoc.suppressions)):
self._HandleError(errors.MISSING_PRIVATE,
'Member "%s" must have @private JsDoc.' %
identifier, token)
Avoid deeply nested control flow statements. Open
Open
if required in error.fix_data:
fixed_tokens.append(token)
# Want to delete: goog.require + open paren + open single-quote +
# text + close single-quote + close paren + semi-colon = 7.
tokenutil.DeleteTokens(token, 7)
Avoid deeply nested control flow statements. Open
Open
for include_dir in include_dirs:
include_dir = include_dir.replace('$SHARED_INTERMEDIATE_DIR',
shared_intermediate_dir)
if not os.path.isabs(include_dir):
base_dir = os.path.dirname(target_name)
Avoid deeply nested control flow statements. Open
Open
if op == 'I':
# Insertion.
# Parsing doc comments is the same for all languages
# but some languages care about parameters that don't have
# doc comments and some languages don't care.
Avoid deeply nested control flow statements. Open
Open
if MatchesSuffixes(f, suffixes):
lint_files.append(os.path.join(root, f))
return lint_files
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(self, lower_bound=None, upper_bound=None):
self.lower_bound = lower_bound
self.upper_bound = upper_bound
sh = self.syntactic_help
if lower_bound is not None and upper_bound is not 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
Avoid deeply nested control flow statements. Open
Open
if (token.line_number == stack[-1].token.line_number):
self._Add(TokenInfo(token))
elif token.metadata.context.type == Context.CASE_BLOCK:
Avoid deeply nested control flow statements. Open
Open
if(options.verbose > 5):
print "<< %s added to delete" % toDelete
remove.add(toDelete)
Avoid deeply nested control flow statements. Open
Open
if not is_immediately_called and (last_in_line or
not token.next.type == Type.SEMICOLON):
self._HandleError(errors.MISSING_SEMICOLON_AFTER_FUNCTION,
'Missing semicolon after function assigned to a variable',
token, Position.AtEnd(token.string))
Avoid deeply nested control flow statements. Open
Open
if jsdoc.HasFlag('inheritDoc') and not jsdoc.HasFlag('constructor'):
self._HandleError(errors.INVALID_INHERIT_DOC_PRIVATE,
'%s should not inherit from a private member.' % identifier,
jsdoc.GetFlag('inheritDoc').flag_token)
if (not jsdoc.HasFlag('private') and
Avoid deeply nested control flow statements. Open
Open
if not identifier or not identifier.type in Type.NON_CODE_TYPES:
break
Avoid deeply nested control flow statements. Open
Open
if (return_flag.type is None or (
'undefined' not in return_flag.type and
'void' not in return_flag.type and
'*' not in return_flag.type)):
self._HandleError(
Avoid deeply nested control flow statements. Open
Open
if not last_in_line and token.next.type == Type.SEMICOLON:
self._HandleError(errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION,
'Illegal semicolon after function declaration',
token.next, Position.All(token.next.string))
Avoid deeply nested control flow statements. Open
Open
if jsdoc.HasFlag('override'):
self._HandleError(errors.INVALID_OVERRIDE_PRIVATE,
'%s should not override a private member.' % identifier,
jsdoc.GetFlag('override').flag_token)
# Can have a private class which inherits documentation from a
Avoid deeply nested control flow statements. Open
Open
for name, value in sorted(tool_settings.iteritems()):
formatted_value = _GetValueFormattedForMSBuild(tool_name, name,
value)
tool.append([name, formatted_value])
group.append(tool)
Avoid deeply nested control flow statements. Open
Open
if len(concrete_output_dirs) > 0:
makefile.write('\t@mkdir -p "%s"\n' %
'" "'.join(concrete_output_dirs))
# The rule message and action have already had the necessary variable
Function WriteActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def WriteActions(self, actions, extra_sources, prebuild,
extra_mac_bundle_resources):
# Actions cd into the base directory.
env = self.GetSortedXcodeEnv()
if self.flavor == 'win':
- 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 _AddConfigurationToMSVS
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name):