Showing 9 of 232 total issues
LinksysInterpreter
has 73 functions (exceeds 20 allowed). Consider refactoring. Open
class LinksysInterpreter(cmd.Cmd):
"""Interpret commands to perform LinkSys programming actions."""
def __init__(self):
cmd.Cmd.__init__(self)
self.session = LinksysSession()
File linksys.py
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
#
# linksys.py -- program settings on a Linkys router
LinksysSession
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class LinksysSession:
months = 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec'
WAN_CONNECT_AUTO = '1'
WAN_CONNECT_STATIC = '2'
Function spawn
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def spawn(self, queue, scheduler):
for spawn in queue:
spawnId = spawn.get('_id')
if spawnId:
- 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 task_webhook
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_webhook(name, _id, endpoint, source=None, method="GET", args={}, chain=[]):
Function task_connections
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_connections(name, _id, endpoint, source='discovery', method="GET", args={}, chain=[]):
Function task_reports
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_reports(name, _id, endpoint, method="GET", source='report', args={}, chain=[]):
Function configure
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def configure(self):
"Write configuration changes to the Linksys."
if self.actions:
fields = []
self.cache_flush()
- 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 task_connections
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def task_connections(name, _id, endpoint, source='discovery', method="GET", args={}, chain=[]):
msg = "Task Connection - %s" % _id
try:
connType = re.search(r'/[a-zA-Z0-9]{24,24}/([a-z-]*)$', endpoint).group(1)
- 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"