iranzo/stampython

View on GitHub

Showing 154 of 154 total issues

Function updatestats has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def updatestats(type=False, id=0, name=False, date=False, memberid=None):
Severity: Minor
Found in stampy/plugin/stats.py - About 35 mins to fix

    Function getstats has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def getstats(type=False, id=0, name=False, date=False, count=0):
    Severity: Minor
    Found in stampy/plugin/stats.py - About 35 mins to fix

      Function remove_from_memberid has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def remove_from_memberid(type=False, id=0, name=False, date=False, memberid=None):
      Severity: Minor
      Found in stampy/plugin/stats.py - About 35 mins to fix

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

        def whois(chat_id=False, user_id=False):
            """
            Use API call to retrieve userid
            :param chat_id:  chat id to locate user into
            :param user_id:  user id to kick out of chat
        Severity: Minor
        Found in stampy/plugin/irccommands.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 autokarmawords has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def autokarmawords(message):
            """
            Finds commands affecting autokarma in messages
            :param message: message to process
            :return:
        Severity: Minor
        Found in stampy/plugin/autokarma.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 helpcommands has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def helpcommands(message):
            """
            Searches for commands related to help
            :param message: nessage to process
            :return:
        Severity: Minor
        Found in stampy/plugin/help.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

        Avoid too many return statements within this function.
        Open

            return
        Severity: Major
        Found in stampy/plugin/irccommands.py - About 30 mins to fix

          Function unban has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def unban(chat_id=False, user_id=False):
              """
              Use API call to have the bot unban user
              :param chat_id: Channel ID to unban user on
              :param user_id: User ID to unban
          Severity: Minor
          Found in stampy/plugin/irccommands.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

          Function getstats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def getstats(type=False, id=0, name=False, date=False, count=0):
              """
              Gets statistics for specified element
              :param type: chat or user type to query
              :param id: identifier for user or chat
          Severity: Minor
          Found in stampy/plugin/stats.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

          Function rank has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def rank(word=False, gid=0):
              """
              Outputs rank for word or top 10
              :param gid: Group ID to filter
              :param word: word to return rank for
          Severity: Minor
          Found in stampy/plugin/karma.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

          Function showstats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def showstats(type=False, name=None, key="name"):
              """
              Shows stats for defined type or all if missing
              :param name: name to search in the stats database
              :param type: user or chat or empy for combined
          Severity: Minor
          Found in stampy/plugin/stats.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

          Function get_currency_rate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get_currency_rate(currency, rate_in):
              """
              Get currency rate
              :param currency: Original Currency
              :param rate_in: Destination Currency
          Severity: Minor
          Found in stampy/plugin/stock.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

          TODO found
          Open

          # TODO
          Severity: Minor
          Found in doc/TODO.md by fixme

          TODO found
          Open

          If you're looking around to see what to contribute, please check 'TODO.md' as it contains information on the already identified missing features.
          Severity: Minor
          Found in doc/CONTRIBUTING.md by fixme
          Severity
          Category
          Status
          Source
          Language