LogCtrl
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class LogCtrl(wx.ListCtrl):
"""
Implementation of a ListCtrl with a circular buffer.
"""
def __init__(self, parent):
File LogCtrl.py
has 276 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 __init__
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent):
self.maxlength = 2000
self.removeOnMax = 200
self.indent = ""
self.OnGetItemText = self.OnGetItemTextWithDT
Function OnCmdCopy
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def OnCmdCopy(self, dummyEvent=None):
text = ""
lines = 1
firstItem = item = self.GetNextItem(
-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"
Further reading
Function OnCmdReplay
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def OnCmdReplay(self, dummyEvent=None):
item = self.GetFirstSelected()
while item != -1:
text, icon = self.GetItemData(item)[:2]
if icon == eg.Icons.EVENT_ICON:
- 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 WriteLine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def WriteLine(self, line, icon, wRef, when, indent):
Function SetDTLogging
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def SetDTLogging(self):
if self.logDates and self.logTimes:
self._datetime_fmt = " {0} %X ".format(eg.config.datestamp)
elif self.logDates:
self._datetime_fmt = " {0} ".format(eg.config.datestamp)
- 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 OnDoubleClick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def OnDoubleClick(self, event):
item, flags = self.HitTest(event.GetPosition())
if flags & wx.LIST_HITTEST_ONITEM:
icon, wref = self.GetItemData(item)[1:3]
if icon != eg.EventItem.icon and wref is not None:
- 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"