errbotio/errbot

View on GitHub

Showing 155 of 224 total issues

Avoid too many return statements within this function.
Open

            return SAFE_ENTITIES[s]
Severity: Major
Found in errbot/rendering/xhtmlim.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return "&" + s
    Severity: Major
    Found in errbot/rendering/xhtmlim.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return SAFE_ENTITIES[s[:x]] + s[x:]
      Severity: Major
      Found in errbot/rendering/xhtmlim.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return self.access_denied(
        Severity: Major
        Found in errbot/core_plugins/acls.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return self.access_denied(
          Severity: Major
          Found in errbot/core_plugins/acls.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return self.access_denied(
            Severity: Major
            Found in errbot/core_plugins/acls.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return self.access_denied(
              Severity: Major
              Found in errbot/core_plugins/acls.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return msg, cmd, args
                Severity: Major
                Found in errbot/core_plugins/acls.py - About 30 mins to fix

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

                  def _ensure_sys_path_contains(paths):
                      """Ensure that os.path contains paths
                      :param paths:
                           a list of base paths to walk from
                           elements can be a string or a list/tuple of strings
                  Severity: Minor
                  Found in errbot/plugin_manager.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 cnf_filter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def cnf_filter(self, msg, cmd, args, dry_run, emptycmd=False):
                          """
                          Check if command exists.  If not, signal plugins.  This plugin
                          will be called twice: once as a command filter and then again
                          as a "command not found" filter. See the emptycmd parameter.
                  Severity: Minor
                  Found in errbot/core_plugins/cnf_filter.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_auth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def get_auth():
                      """Get auth creds from Github Token
                  
                      token is generated from the personal tokens in github
                      """
                  Severity: Minor
                  Found in tools/plugin-gen.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 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