EventGhost/EventGhost

View on GitHub
plugins/EventGhost/ShowMessageBox.py

Summary

Maintainability
F
3 days
Test Coverage

File ShowMessageBox.py has 470 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 plugins/EventGhost/ShowMessageBox.py - About 7 hrs to fix

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

        def Configure(
            self,
            title = "",
            body = "",
            alias = "",
    Severity: Minor
    Found in plugins/EventGhost/ShowMessageBox.py - About 2 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 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def Configure(
            self,
            title = "",
            body = "",
            alias = "",
    Severity: Major
    Found in plugins/EventGhost/ShowMessageBox.py - About 2 hrs to fix

      Function getFlags has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def getFlags(self, options, twk = True):
              if twk:
                  optionid = (options - options % 4096) / 4096
              else:
                  optionid = 0
      Severity: Minor
      Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr 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 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def __init__(
              self,
              parent,
              title = "",
              message = "",
      Severity: Minor
      Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr to fix

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

            def __call__(
                self,
                title = "",
                body = "",
                alias = "",
        Severity: Minor
        Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(
                self,
                parent,
                title = "",
                message = "",
        Severity: Minor
        Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr 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 showTweakedBox has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def showTweakedBox(self, parent, title, message, alias, payload, flags, time, event):
        Severity: Major
        Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr to fix

          Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(
          Severity: Major
          Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr to fix

            Function Configure has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def Configure(
            Severity: Major
            Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr to fix

              Function __call__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __call__(
              Severity: Major
              Found in plugins/EventGhost/ShowMessageBox.py - About 1 hr to fix

                Function showMessageBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def showMessageBox(self, title, body, alias, payload, options):
                Severity: Minor
                Found in plugins/EventGhost/ShowMessageBox.py - About 45 mins to fix

                  Function onClose has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def onClose(self, evt):
                          retCode = self.GetReturnCode()
                          if retCode not in self.LABELS:
                              return
                          if self.timer:
                  Severity: Minor
                  Found in plugins/EventGhost/ShowMessageBox.py - About 35 mins 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 showMessageBox has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def showMessageBox(self, title, body, alias, payload, options):
                          if not alias:
                              alias = title
                          result = MessageBox(0, body, title, options)
                  
                  
                  Severity: Minor
                  Found in plugins/EventGhost/ShowMessageBox.py - About 25 mins 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

                  There are no issues that match your filters.

                  Category
                  Status