EventGhost/EventGhost

View on GitHub

Showing 1,842 of 2,440 total issues

Cyclomatic complexity is too high in method CheckEmails. (51)
Open


    def CheckEmails(self):
        accList=[n[0] for n in self.configs]
        accounts = []
        observName = self.setup[0]
Severity: Minor
Found in plugins/E-mail/__init__.py by radon

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.

Source: http://radon.readthedocs.org/en/latest/intro.html

File __init__.py has 450 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
Severity: Minor
Found in plugins/Barco/__init__.py - About 6 hrs to fix

    Function ValueUpdate has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        def ValueUpdate(self, text):
            if text == self.waitStr:
                self.waitStr = None
                self.waitFlag.set()
                return
    Severity: Minor
    Found in plugins/ZoomPlayer/__init__.py - About 6 hrs to fix

    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 447 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    eg.RegisterPlugin(
        name = "Sound Mixer Ex",
        author = "Dexter",
        version = "1.1.1204",
        description = (
    Severity: Minor
    Found in plugins/SoundMixerEx/__init__.py - About 6 hrs to fix

      File FindWindow.py has 446 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      #
      # This file is a plugin for EventGhost.
      # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
      #
      Severity: Minor
      Found in plugins/Window/FindWindow.py - About 6 hrs to fix

        Function Configure has 167 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def Configure(
                self,
                Prefix = "Remote",
                remotes = [],
                suffixes = None
        Severity: Major
        Found in plugins/RemoteEventMapper/__init__.py - About 6 hrs to fix

          Function __call__ has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

              def __call__(
                  self,
                  rangeName,
                  iTimeAhead,
                  tlStartType,
          Severity: Minor
          Found in plugins/SunTracker/__init__.py - About 6 hrs to fix

          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 43 (exceeds 5 allowed). Consider refactoring.
          Open

              def Configure(
                  self,
                  fore = (75, 75, 75),
                  back = (180, 180, 180),
                  fontInfo = "0;-48;0;0;0;400;0;0;0;238;0;0;0;0;MS Shell Dlg 2",
          Severity: Minor
          Found in plugins/OSE/__init__.py - About 6 hrs to fix

          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 timeCheck has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

              def timeCheck(self, timeIntervals):
                  t_list = [0]*6
          
                  for i in range(0,3):
                      theTime_1 = timeIntervals[i]
          Severity: Minor
          Found in plugins/Scheduler/__init__.py - About 6 hrs to fix

          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 43 (exceeds 5 allowed). Consider refactoring.
          Open

              def Configure(self, parent, checkMultiLoad=True, title=None):
                  if title is None:
                      title = Text.title
                  self.checkMultiLoad = checkMultiLoad
                  if self.__class__.instance:
          Severity: Minor
          Found in eg/Classes/AddPluginDialog.py - About 6 hrs to fix

          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 AboutDialog.py has 438 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/>
          #
          Severity: Minor
          Found in eg/Classes/AboutDialog.py - About 6 hrs to fix

            Cyclomatic complexity is too high in method JSONRPCNotifications. (49)
            Open

                def JSONRPCNotifications(self, stopJSONRPCNotifications):
                        import os
                        import struct
                        from collections import deque
                        import select
            Severity: Minor
            Found in plugins/XBMCRepeat/__init__.py by radon

            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.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Cyclomatic complexity is too high in method OnReceive. (49)
            Open

                def OnReceive(self, serial):
                    buffer = serial.Read(7, 1.0)
                    if len(buffer) == 7:
                        code = buffer[3:5]
                        if code == "MD":
            Severity: Minor
            Found in plugins/JvcDlaSerial/__init__.py by radon

            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.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Function Configure has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
            Open

                def Configure(
                    self,
                    fore = (75, 75, 75),
                    back = (180, 180, 180),
                    fontInfo = arialInfoString,
            Severity: Minor
            Found in plugins/MediaPlayerClassic/__init__.py - About 6 hrs to fix

            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 __call__ has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
            Open

                def __call__( self,
                    allRecordings=False,
                    enableDVBViewer=True,
                    enableDVBService=True,
                    updateDVBService=False,
            Severity: Minor
            Found in plugins/DVBViewer/__init__.py - About 6 hrs to fix

            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 42 (exceeds 5 allowed). Consider refactoring.
            Open

                def __init__(
                    self,
                    parent,
                    message,
                    caption = eg.APP_NAME,
            Severity: Minor
            Found in plugins/RadioSure/__init__.py - About 6 hrs to fix

            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 42 (exceeds 5 allowed). Consider refactoring.
            Open

                def Configure(
                    self,
                    fore = (75, 75, 75),
                    back = (180, 180, 180),
                    fontInfo = TAHOMA_INFO,
            Severity: Minor
            Found in plugins/RadioSure/__init__.py - About 6 hrs to fix

            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 160 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def Configure(
                    self,
                    configs=[],
                    servers=[],
                    texts = [],
            Severity: Major
            Found in plugins/E-mail/__init__.py - About 6 hrs to fix

              Function Configure has 158 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def Configure(
                      self,
                      choices = [],
                      fore = (0, 0, 0),
                      back = (255, 255, 255),
              Severity: Major
              Found in plugins/OOo_Impress/__init__.py - About 6 hrs to fix

                Function Configure has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                    def Configure(
                        self,
                        configs=[],
                    ):
                        def boxEnable(enable):
                Severity: Minor
                Found in plugins/Multitap/__init__.py - About 6 hrs to fix

                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

                Severity
                Category
                Status
                Source
                Language