File __init__.py
has 933 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/>
#
MainFrame
has 88 functions (exceeds 20 allowed). Consider refactoring. Open
class MainFrame(wx.Frame):
"""
This is the MainFrame of EventGhost
"""
style = (
Function OnCmdPythonShell
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def OnCmdPythonShell(self):
if eg.pyCrustFrame:
eg.pyCrustFrame.Raise()
return
- 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 CreateMenuBar
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateMenuBar(self):
"""
Creates the main menu bar and all its menus.
"""
text = Text.Menu
Function __init__
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, document):
"""
Create the MainFrame
"""
self.document = document
Function CreateToolBar
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateToolBar(self):
"""
Creates the toolbar of the frame.
"""
toolBar = wx.ToolBar(self, style=wx.TB_FLAT)
Function UpdateSize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def UpdateSize(self):
if eg.config.propResize:
panel = self.auiManager.GetPane("logger")
if panel.IsDocked():
s = self.auiManager.SavePerspective()
- 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 CreateTreePopupMenu
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateTreePopupMenu(self):
"""
Creates the pop-up menu for the configuration tree.
"""
menu = wx.Menu()
Function UpdateRatio
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def UpdateRatio(self):
self.logCtrl.SetColumnWidth(
0,
self.logCtrl.GetSizeTuple()[0] - self.corConst
)
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, document):
"""
Create the MainFrame
"""
self.document = document
- 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"