iranzo/stampython

View on GitHub

Showing 97 of 154 total issues

Function getall has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def getall(message):
    """
    Processes 'all' in messages
    :param message:  message to analyze
    :return:
Severity: Minor
Found in stampy/plugin/stats.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 autokcommands has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def autokcommands(message):
    """
    Processes autok commands in the message texts
    :return:
    """
Severity: Minor
Found in stampy/plugin/autokarma.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 hilightwords has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def hilightwords(message):
    """
    Finds hilight words in messages
    :param message: message to process
    :return:
Severity: Minor
Found in stampy/plugin/highlight.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 op has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def op(chat_id=False, user_id=False, extra=""):
    """
    Use API call to have the bot op user in
    :param chat_id:  chat id to locate user into
    :param user_id:  user id to op
Severity: Minor
Found in stampy/plugin/irccommands.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 forwardcommands has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def forwardcommands(message):
    """
    Processes forward commands in the message texts
    :param message: Message to process
    :return:
Severity: Minor
Found in stampy/plugin/forward.py - About 3 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 aliascommands has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def aliascommands(message):
    """
    Processes alias commands in the message texts
    :param message: Message to process
    :return:
Severity: Minor
Found in stampy/plugin/alias.py - About 3 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 deletemessage has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def deletemessage(chat_id=0, message_id=False):
    """
    Deletes a message from a chat
    :param chat_id: chat_id to delete the message
    :param message_id: message to delete
Severity: Minor
Found in stampy/stampy.py - About 3 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 comiccommands has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def comiccommands(message):
    """
    Processes comic commands in the message texts
    :param message: Message to process
    :return:
Severity: Minor
Found in stampy/plugin/comic.py - About 3 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 karmacommands has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def karmacommands(message):
    """
    Finds for commands affecting karma in messages
    :param message: message to process
    :return:
Severity: Minor
Found in stampy/plugin/karma.py - About 3 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 statscommands has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def statscommands(message):
    """
    Processes stats commands in the messages
    :param message: message to process
    :return:
Severity: Minor
Found in stampy/plugin/stats.py - About 3 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 doforward has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def doforward(message, target):
    """
    Forwards a message target chatid
    :param message: Message to process (containing all details)
    :param target: Target chat_id
Severity: Minor
Found in stampy/plugin/forward.py - About 3 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 feed.py has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# encoding: utf-8
#
# Description: Plugin for processing rss feeds
# Author: Pablo Iranzo Gomez (Pablo.Iranzo@gmail.com)
Severity: Minor
Found in stampy/plugin/feed.py - About 3 hrs to fix

    File comic.py has 290 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    # encoding: utf-8
    #
    # Description: Plugin for processing comic commands
    # Author: Pablo Iranzo Gomez (Pablo.Iranzo@gmail.com)
    Severity: Minor
    Found in stampy/plugin/comic.py - About 2 hrs to fix

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

      def cn(message):
          """
          Processes cn commands
          :param message: Message with the command
          :return:
      Severity: Minor
      Found in stampy/plugin/chuck.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 is_owner_or_admin has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      def is_owner_or_admin(message, strict=False):
          """
          Check if user is owner or admin for group
          :param strict: Defines if we target the actual gid, not effective
          :param message: message to check
      Severity: Minor
      Found in stampy/stampy.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 getmsgdetail has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      def getmsgdetail(message):
          """
          Gets message details and returns them as dict
          :param message: message to get details from
          :return: message details as dict
      Severity: Minor
      Found in stampy/stampy.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 main has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def main():
          """
          Main code for the bot
          """
      
      
      Severity: Minor
      Found in stampy/stampy.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 updatestats has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      def updatestats(type=False, id=0, name=False, date=False, memberid=None):
          """
          Updates count stats for a given type
          :param type: user or chat
          :param id: ID to update
      Severity: Minor
      Found in stampy/plugin/stats.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 mute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def mute(chat_id=False, user_id=False, extra=""):
          """
          Use API call to have the bot op user in
          :param chat_id:  chat id to locate user into
          :param user_id:  user id to op
      Severity: Minor
      Found in stampy/plugin/irccommands.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 espp has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      def espp(message):
          """
          Processes espp commands
          :param message: Message with the command
          :return:
      Severity: Minor
      Found in stampy/plugin/espp.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

      Severity
      Category
      Status
      Source
      Language