Showing 12 of 36 total issues
Function cli
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def cli(cls, singleton=False, history=True, writable=True, live=True, device=True):
group = click.Group(name='timeseries',
short_help="Commands on timeseries readings.")
resource_type = cls._resource_type()
- 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 cli
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def cli(cls, singleton=False):
group = click.Group(name='metadata',
short_help="Commands on metadata.")
resource_type = cls._resource_type()
- 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 resource_lookup
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def resource_lookup(cls, client, id_rep,
Function cli
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cli(cls, singleton=False, history=True, writable=True, live=True, device=True):
Function update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(client, config, add, remove, type, mac):
Function resource_filter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def resource_filter(cls, client, value,
Function display_map
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def display_map(cls, client, uuid=False, include=None):
def _trim_id(res):
return res.id if uuid or client.uuid else res.short_id
def _config(self):
- 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 update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(client, sensor, name, mac, **kwargs):
Function update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(client, element, name, mac, **kwargs):
Function filter_oneof
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def filter_oneof(lookup_filters):
def id_func(id_rep):
resource_filters = [f(id_rep) for f in lookup_filters]
def func(resource):
- 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 convert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convert(self, value, param, ctx):
def collect_resources(acc, resource_rep):
if resource_rep.startswith('@'):
for line in click.open_file(resource_rep[1:]):
acc.append(line.strip())
- 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 main_wrapper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def main_wrapper(cmd, args, **kwargs):
if args is None:
args = sys.argv[1:]
def decorator():
- 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"