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/>
#
Function OnDragOver
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def OnDragOver(self, x, y, dummyDragResult):
"""
Called when the mouse is being dragged over the drop target.
"""
tree = self.treeCtrl
- 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
TreeCtrl
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class TreeCtrl(wx.TreeCtrl):
@eg.AssertInMainThread
def __init__(self, parent, document, size=wx.DefaultSize):
self.document = document
self.root = None
Function __init__
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent, document, size=wx.DefaultSize):
self.document = document
self.root = None
self.editLabelId = None
self.insertionMark = None
Function OnNodeSelected
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def OnNodeSelected(self, node):
"""
Handles eg.Notify("NodeSelected")
"""
if node not in self.visibleNodes:
- 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 CollapseAllChildren
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def CollapseAllChildren(self, item_id):
"""
Collapses all children of the selected item.
"""
if not item_id.IsOk():
- 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 OnData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def OnData(self, dummyX, dummyY, dragResult):
"""
Overrides wx.DropTarget.OnData
Called after OnDrop returns true. By default this will usually GetData
- 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 ExpandAllChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ExpandAllChildren(self, item_id):
"""
Expands all items in the tree.
"""
if not item_id.IsOk():
- 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 OnNodeChanged
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def OnNodeChanged(self, node):
"""
Handles eg.Notify("NodeChanged")
"""
if node not in self.visibleNodes:
- 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 CreateTreeItemAt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def CreateTreeItemAt(self, node, parentId, parentNode, pos):
if pos == -1 or pos >= len(parentNode.childs):
return self.CreateTreeItem(node, parentId)
else:
itemId = self.InsertItemBefore(
- 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 OnLeftDoubleClickEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def OnLeftDoubleClickEvent(self, event):
"""
Handles wx.EVT_LEFT_DCLICK
"""
itemId = self.HitTest(event.GetPosition())[0]
- 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 OnNodeAdded
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def OnNodeAdded(self, (node, pos)):
"""
Handles eg.Notify("NodeAdded")
"""
parentNode = node.parent
- 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"