File config.py
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
Function validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate(self):
"""Ensure we have all the settings we need before continuing."""
if getattr(self, "org", None) is None:
err = (
"The parameter org must be provided in the config file "
- 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 interactive_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def interactive_config(self):
"""Runs an interactive configuration to make it simpler to create
the config file. Always uses default path.
"""
LOG.info("Interactive setup requested")
- 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 read_yaml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_yaml(filename, raise_on_error=False):
"""Read a YAML file and optionally raise if anything goes wrong."""
config = {}
try:
if os.path.isfile(filename):
- 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"