Showing 10 of 307 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 factory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def factory(self, input, owner_id):
mapp = self.__mapper()
prev = ''
prepared = []
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, field, lens=None, sublens='_id', include=[], opts={}):
Function task_upload
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_upload(report_id, owner_user, name, result, type=None):
Function getAll
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def getAll(self, filter={}, limit=10, skip=0, orderBy='updated_at', direction=-1):
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
Avoid too many return
statements within this function. Open
return json.JSONEncoder.default(self, obj)
Function post
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def post(self):
"""
@api {post} /reports Insert Batch Process
@apiName PostReport
@apiGroup Reports
- 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"