EventGhost/EventGhost

View on GitHub
plugins/PS3/__init__.py

Summary

Maintainability
F
3 days
Test Coverage

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

README = """\
<u><b>1) Bluetooth</b></u>

Tested succesfully working with Bluetooth Software :
WIDCOMM Bluetooth Software 5.1.0.1100.
Severity: Major
Found in plugins/PS3/__init__.py - About 1 day to fix

    Function RawCallback has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        def RawCallback(self, data):
            #hexdata= binascii.hexlify(data).upper()
            #eg.PrintNotice( hexdata )
    
            try:
    Severity: Minor
    Found in plugins/PS3/__init__.py - About 4 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 26 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def Configure(self,
    Severity: Major
    Found in plugins/PS3/__init__.py - About 3 hrs to fix

      Function GetLabel has 21 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def GetLabel(self,
      Severity: Major
      Found in plugins/PS3/__init__.py - About 2 hrs to fix

        Function __start__ has 21 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __start__(self,
        Severity: Major
        Found in plugins/PS3/__init__.py - About 2 hrs to fix

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

              def Configure(self,
                  eventName = "",
                  enduringEvents = True,
                  rawDataEvents = False, # no longer used
                  ps3DataEvents = False, # no longer used
          Severity: Major
          Found in plugins/PS3/__init__.py - About 2 hrs to fix

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

                def Configure(self,
                    eventName = "",
                    enduringEvents = True,
                    rawDataEvents = False, # no longer used
                    ps3DataEvents = False, # no longer used
            Severity: Minor
            Found in plugins/PS3/__init__.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

            Avoid deeply nested control flow statements.
            Open

                                        if( bit not in self.PS3Remote.maskbit ):
                                            PS3ParseError( 'Mask', 'various', bin(mask) )
                                        btnPressed.append( self.PS3Remote.maskbit[bit] )
            Severity: Major
            Found in plugins/PS3/__init__.py - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status