Function _smartos_zone_pkgsrc_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _smartos_zone_pkgsrc_data():
'''
SmartOS zone pkgsrc information
'''
# Provides:
- 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 _smartos_zone_pkgin_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _smartos_zone_pkgin_data():
'''
SmartOS zone pkgin information
'''
# Provides:
- 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 _smartos_computenode_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _smartos_computenode_data():
'''
Return useful information from a SmartOS compute node
'''
# Provides:
- 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 pkginrepo.match(line):
grains['pkgin_repositories'].append(line)
Avoid deeply nested control flow statements. Open
if match_pkgsrcpath:
grains['pkgsrcpath'] = match_pkgsrcpath.group(1)
match_pkgsrcversion = pkgsrcversion.match(match_pkgsrcpath.group(1))
if match_pkgsrcversion:
grains['pkgsrcversion'] = match_pkgsrcversion.group(1)
Function _smartos_zone_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _smartos_zone_data():
'''
Return useful information from a SmartOS zone
'''
# Provides:
- 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"