File Utils.py
has 376 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 GetHwndIcon
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def GetHwndIcon(hWnd):
"""
Get a wx.Icon from a window through its hwnd window handle
"""
hIcon = DWORD()
- 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 BestWindowFromPoint
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def BestWindowFromPoint(point):
x, y = point
foundWindow = WindowFromPoint(POINT(x, y))
hWnds = GetWindowChildsList(GetAncestor(foundWindow, GA_ROOT), True)
- 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 KillProcess
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def KillProcess(pid = None, processName = None, hwnd = None, signal = 0, restart = False):
if pid:
pass
elif processName:
pids = GetPids(processName = processName)
- 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 GetHwnds
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def GetHwnds(pid = None, processName = None):
if pid:
pass
elif processName:
pids = GetPids(processName = processName)
- 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 PySendMessageTimeout
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def PySendMessageTimeout(
Function KillProcess
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def KillProcess(pid = None, processName = None, hwnd = None, signal = 0, restart = False):
Avoid too many return
statements within this function. Open
return False
Function BringHwndToFront
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def BringHwndToFront(hWnd, invalidate=True):
if hWnd is None:
return
hWnd = GetAncestor(hWnd, GA_ROOT)
if not IsWindow(hWnd):
- 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"