errbotio/errbot

View on GitHub

Showing 224 of 224 total issues

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

    def poller(
        self,
        interval: float,
        method: Callable[..., None],
        times: int = None,
Severity: Minor
Found in errbot/botplugin.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 repos has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def repos(self, _, args):
        """list the current active plugin repositories"""

        installed_repos = self._bot.repo_manager.get_installed_plugin_repos()

Severity: Minor
Found in errbot/core_plugins/plugins.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 callback_connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def callback_connect(self):
        self.log.info("Connecting bot chatrooms")
        if not self.connected:
            self.connected = True
            for room in self.bot_config.CHATROOM_PRESENCE:
Severity: Minor
Found in errbot/core_plugins/chatRoom.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 __str__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __str__(self):
        response = ""
        if self._reactor:
            response += f'reactor: "{self._reactor}" '
        if self._reaction_name:
Severity: Minor
Found in errbot/backends/base.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

Severity
Category
Status
Source
Language