Showing 32 of 598 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 merge
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def merge(self, insert):
if not isinstance(self.content, list) or len(self.content) <= 0:
return insert
santinize = []
- 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 getZones
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def getZones(source, batch):
zones = Ruler.switch(source, batch)
if zones:
if isinstance(zones, str):
- 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 cpuAndMemoryByInstanceType
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def cpuAndMemoryByInstanceType(obj, conn):
instance = get(obj, 'datacenters.instance')
if instance:
data = CacheMemory.get(instance)
- 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 InstanceTypeOpenStack
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def InstanceTypeOpenStack(source, batch, obj={}):
instance = Ruler.switch(source, batch)
if instance:
obj = CacheMemory.get(instance)
- 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 cpuAndMemoryByInstanceType
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def cpuAndMemoryByInstanceType(obj, conn):
instance = get(obj, 'datacenters.instance')
if instance:
data = CacheMemory.get(instance)
- 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_scan
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def task_scan(conn, conn_id, task, options, lasted=False, vars=[]):
access = decodeConn(conn, conn_id, task)
oVars = Normalize.optionsVarsNormalize(options['vars']),
vars = sum(oVars, vars)
- 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 batch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def batch(self, items, Ruler, source={}):
for key, item in items:
res = getattr(Ruler, item.get('call'))(item.get('source'), source)
if isinstance(res, dict):
- 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 iterTranslate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def iterTranslate(conn, conn_id, options, task, result, tlasted):
Function task_translate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_translate(conn, conn_id, options, task, result, lasted=False):
Function entity_count
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def entity_count(dc_id, owner, region, accountant, resources, options):
Function task_tracker
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_tracker(result, dc_id, region, task, accountant, options):
Function task_insert
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_insert(conn, conn_id, task, result, options, lasted=False):
Function task_scan
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def task_scan(conn, conn_id, task, options, lasted=False, vars=[]):
Function make_query
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_query(dc_id, owner, region, accountant, resources, options):
Function merger_with
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def merger_with(self, obj_value, src_value, key, obj, source):
Function get_data_list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_data_list(result, key, owner_user, conn_id, entity):
Function spawnScan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def spawnScan(self, connector, region, task, commands, lasted):