Showing 40 of 92 total issues
Function buildC11Type
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def buildC11Type(self, schemaValue):
c11Type = None
if u'type' in schemaValue:
schemaValueType = schemaValue[u'type']
if schemaValueType == u'bool' or schemaValueType == u'boolean':
- 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 codeDefaultValueArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def codeDefaultValueArray(self, schemaDefaultValues):
if schemaDefaultValues is None\
or not isinstance(schemaDefaultValues, list)\
or len(schemaDefaultValues) <= 0:
return u''
- 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
for code_header_extra_line in code_header_extra_lines:
header_file.write(code_header_extra_line)
header_file.write(u'\n')
Avoid deeply nested control flow statements. Open
for code_file_line in code_file_lines:
header_file.write(u' * ' + code_file_line)
header_file.write(u' */\n')
Avoid deeply nested control flow statements. Open
for code_header_extra_line in code_header_extra_lines:
header_file.write(code_header_extra_line)
header_file.write(u'\n')
Avoid deeply nested control flow statements. Open
for code_file_line in code_file_lines:
header_file.write(u' * ' + code_file_line)
header_file.write(u' */\n')
Avoid deeply nested control flow statements. Open
for code_file_line in code_file_lines:
source_file.write(u' * ' + code_file_line)
source_file.write(u' */')
Function getParentTypeNames
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getParentTypeNames(self, recursion=True, withDeclare=False, asVariable=False, withObject=False):
parentTypeNames = []
for key in self.parents:
parent = self.parents[key]
if recursion:
- 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
for code_header_extra_line in code_header_extra_lines:
header_file.write(code_header_extra_line)
header_file.write(u'\n')
Avoid deeply nested control flow statements. Open
for code_header_extra_line in code_header_extra_lines:
header_file.write(code_header_extra_line)
header_file.write(u'\n')
Avoid deeply nested control flow statements. Open
for code_file_line in code_file_lines:
source_file.write(u' * ' + code_file_line)
source_file.write(u' */\n')
Avoid deeply nested control flow statements. Open
for code_header_extra_line in code_header_extra_lines:
header_file.write(code_header_extra_line)
header_file.write(u'\n')
Avoid deeply nested control flow statements. Open
for code_header_extra_line in code_header_extra_lines:
header_file.write(code_header_extra_line)
header_file.write(u'\n')
Function setCodes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def setCodes(self, manualCodeHeaders, manualCodeSourcesVariable, manualCodeSourcesFunction, manualCodeParsersFrom, manualCodeParsersTo):
Function generate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate(self, codeFileName, outputHeaderPath=None, outputSourcePath=None, nameSpace=None, config=None):
Avoid too many return
statements within this function. Open
return (error_code, error_message)
Avoid too many return
statements within this function. Open
return (error_code, error_message)
Avoid too many return
statements within this function. Open
return (error_code, error_message)
Avoid too many return
statements within this function. Open
return (0, u'')
Function revise
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def revise(self, c11Types):
for key in self.parents:
if key not in c11Types:
return (1, u'Can\'t find the parent %s in %s' % (key, self.codeTypeName()))
self.parents[key] = c11Types[key]
- 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"