Showing 1,842 of 2,440 total issues
Function handle_read
has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring. Open
def handle_read(self):
# Append data from the socket onto a buffer
self.buffer += self.recv(4096)
# Attempt to detect delimeter used..
if self.delimeter == '':
- 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
File __init__.py
has 918 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
version="0.1.7"
# Copyright (C) 2008-2011 Pako (lubos.ruckl@quick.cz)
Function Update
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
def Update( self, updateMode=UPDATE_TIMERS ) :
def GetID( *args ) :
m = hashlib.md5()
- 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
File __init__.py
has 858 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
version="0.1.6"
# plugins/ScreamerRadio/__init__.py
Function Configure
has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring. Open
def Configure(self, method="JSONRPC.Introspect", param="", log=True, wait=True):
class record:
Namespaces = ['No namespaces']
Methods = {'No namespaces':['No methods']}
Descriptions = {'No namespaces':['']}
- 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
Cyclomatic complexity is too high in method NextRun. (107) Open
def NextRun(self, type, data):
def FindRunDateTime(runList, cond):
runList.sort()
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
File __init__.py
has 798 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 MonsterMagnet
#
# This file is a plugin for EventGhost.
Function GetFolderItems
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
def GetFolderItems(folder, patterns, hide):
shortcut = pythoncom.CoCreateInstance (
shell.CLSID_ShellLink,
None,
pythoncom.CLSCTX_INPROC_SERVER,
- 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
File __init__.py
has 778 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# /plugins/Phoner/__init__.py
#
# Copyright (C) 2009 Pako <lubos.ruckl@quick.cz>
File __init__.py
has 766 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
Function ShowGroupsDlg
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
def ShowGroupsDlg(self):
text = self.plugin.text
self.SetTitle(text.groupsTitle)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.SetMinSize((450, 307))
- 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
File __init__.py
has 759 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
Function Configure
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
def Configure(
self,
choices="",
fore = (75, 75, 75),
back = (180, 180, 180),
- 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 run
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
while 1:
errorList = ('strict','ignore','replace')
try:
input = codecs.open(self.fileName,'r',self.inPage, errorList[self.errDecMode])
- 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
File __init__.py
has 739 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
version="0.3.5"
# Plugins/Billy/__init__.py
MainFrame
has 88 functions (exceeds 20 allowed). Consider refactoring. Open
class MainFrame(wx.Frame):
"""
This is the MainFrame of EventGhost
"""
style = (
Function __call__
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
def __call__(
self,
num_bytes=None,
timeout=1,
returnformat="Hex",
- 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 Configure
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
def Configure(
self,
choices = [],
fore = (0, 0, 0),
back = (255, 255, 255),
- 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
File TreeCtrl.py
has 717 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
File Registry.py
has 714 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#