Showing 376 of 566 total issues
Avoid deeply nested control flow statements. Open
if self.include_type(ty, included_types):
result.append(r)
else:
Avoid deeply nested control flow statements. Open
with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\{}{}'.format(x, globals()[versionVarName])) as reg_key:
vc_path = _winreg.QueryValueEx(reg_key, "ProductDir")[0]
except:
Avoid deeply nested control flow statements. Open
for t in result:
t.always()
Function process_boostbook_build_log
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_boostbook_build_log( path, timestamp ):
f = open( path + '.xml', 'w' )
g = xml.sax.saxutils.XMLGenerator( f )
lines = open( path ).read().splitlines()
output_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
Avoid deeply nested control flow statements. Open
if p:
assert(len(p) == 1)
result += join_tag(ungrist(f), p)
else:
Function cpu_flags
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cpu_flags(toolset, variable, architecture, instruction_set, values, default=None):
Function create_typed_metatarget
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_typed_metatarget(name, type, sources, requirements, default_build, usage_requirements):
Avoid deeply nested control flow statements. Open
if global_setup:
setup_cpu = global_setup
# If needed we can easily add using configuration flags
# here for overriding which options get passed to the
# global setup command for which target platform:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__ (self, name, project, sources, requirements = None, default_build = None, usage_requirements = None):
Function collect_targets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def collect_targets(self, targets):
s = [t.creating_subvariant() for t in targets]
s = unique(s)
- 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
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def install(name, package_name=None, requirements=[], binaries=[], libraries=[], headers=[]):
Function create_metatarget
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_metatarget(klass, name, sources, requirements=[], default_build=[], usage_requirements=[]):
Function run_fail
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_fail(sources, args, input_files, requirements, target_name=None, default_build=[]):
Avoid deeply nested control flow statements. Open
for m in n.childNodes:
if m.nodeName == 'member':
cpp = self._cppName(self._getChildData('name',root=m))
entry = {
'name' : cpp['name'],
Function merge_xmls_task
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def merge_xmls_task( source_dir, processed_dir, merged_dir, expected_results_file, failures_markup_file, tag ):
Avoid deeply nested control flow statements. Open
if p1 == p2:
result = t
Function run
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(sources, args, input_files, requirements, target_name=None, default_build=[]):
Function _rewriteIDs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _rewriteIDs( self, node ):
if node.nodeName in ('link'):
if (self.idmap.has_key(node.getAttribute('linkend'))):
#~ A link, and we have someplace to repoint it at.
node.setAttribute('linkend',self.idmap[node.getAttribute('linkend')])
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__ (self, main_target, prop_set, sources, build_properties, sources_usage_requirements, created_targets):
Avoid deeply nested control flow statements. Open
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
if node.firstChild:
log_data = xml.sax.saxutils.escape(node.firstChild.data)
else:
log_data = ''