errbotio/errbot

View on GitHub

Showing 155 of 224 total issues

Function _start has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        }, _start: function (a) {
            var d = {}, e, c;
            a = l(a);
            e = b.group[a] || null;
            if (!e)return!1;
Severity: Minor
Found in docs/_static/fancybox/jquery.fancybox.pack.js - About 1 hr to fix

    Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in errbot/backends/base.py - About 1 hr to fix

      Function send_card has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def send_card(
      Severity: Major
      Found in errbot/botplugin.py - About 1 hr to fix

        Function beforeShow has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                beforeShow: function (opts) {
                    var current = F.current,
                        text = current.title,
                        type = opts.type,
                        title,
        Severity: Minor
        Found in docs/_static/fancybox/jquery.fancybox.js - About 1 hr to fix

          Function play has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  play: function (action) {
                      var clear = function () {
                              clearTimeout(F.player.timer);
                          },
                          set = function () {
          Severity: Minor
          Found in docs/_static/fancybox/jquery.fancybox.js - About 1 hr to fix

            Function fancybox has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.fn.fancybox = function (options) {
                    var index,
                        that = $(this),
                        selector = this.selector || '',
                        run = function (e) {
            Severity: Minor
            Found in docs/_static/fancybox/jquery.fancybox.js - About 1 hr to fix

              Function which has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              def which(program: str) -> Optional[str]:
                  if ON_WINDOWS:
                      program += ".exe"
              
                  def is_exe(file_path):
              Severity: Minor
              Found in errbot/repo_manager.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 build_identifier has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  def build_identifier(
                      self, txtrep: str
                  ) -> Union[XMPPRoomOccupant, XMPPRoom, XMPPPerson]:
                      log.debug("build identifier for %s", txtrep)
                      try:
              Severity: Minor
              Found in errbot/backends/xmpp.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 status_plugins has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  def status_plugins(self, _, args):
                      """shows the plugin status"""
                      pm = self._bot.plugin_manager
                      all_blacklisted = pm.get_blacklisted_plugin()
                      all_loaded = pm.get_all_active_plugin_names()
              Severity: Minor
              Found in errbot/core_plugins/health.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 arg_botcmd has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def arg_botcmd(
              Severity: Major
              Found in errbot/__init__.py - About 1 hr to fix

                Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(
                Severity: Major
                Found in errbot/backends/xmpp.py - About 1 hr to fix

                  Function botcmd has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def botcmd(
                  Severity: Major
                  Found in errbot/__init__.py - About 1 hr to fix

                    Function send_message has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def send_message(self, msg: Message) -> None:
                            if self.demo_mode:
                                print(self.md_ansi.convert(msg.body))
                            else:
                                bar = "\n╌╌[{mode}]" + ("╌" * 60)
                    Severity: Minor
                    Found in errbot/backends/text.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 index_update has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def index_update(self) -> None:
                            index = {LAST_UPDATE: datetime.now().timestamp()}
                            for source in reversed(self.plugin_indexes):
                                try:
                                    if urlparse(source).scheme in ("http", "https"):
                    Severity: Minor
                    Found in errbot/repo_manager.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 route has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def route(obj):
                        """Check for functions to route in obj and route them."""
                        flask_app = errbot.core_plugins.flask_app
                        classname = obj.__class__.__name__
                        log.info("Checking %s for webhooks", classname)
                    Severity: Minor
                    Found in errbot/core_plugins/wsview.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 check_inflight_flow_triggered has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def check_inflight_flow_triggered(
                            self, cmd: str, user: Identifier
                        ) -> Tuple[Optional[Flow], Optional[FlowNode]]:
                            """
                            Check if a command from a specific user was expected in one of the running flow.
                    Severity: Minor
                    Found in errbot/flow.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 repos_install has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def repos_install(self, _, args):
                            """install a plugin repository from the given source or a known public repo (see !repos to find those).
                            for example from a known repo: !install err-codebot
                            for example a git url: git@github.com:gbin/plugin.git
                            or an url towards an archive: https://github.com/errbotio/err-helloworld/archive/refs/heads/master.zip
                    Severity: Minor
                    Found in errbot/core_plugins/plugins.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 room_topic has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def room_topic(self, message, args):
                            """
                            Get or set the topic for a room.
                    
                            Usage:
                    Severity: Minor
                    Found in errbot/core_plugins/chatRoom.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 changeIn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            changeIn: function () {
                                var current = F.current,
                                    effect = current.nextEffect,
                                    startPos = current.pos,
                                    endPos = { opacity: 1 },
                    Severity: Minor
                    Found in docs/_static/fancybox/jquery.fancybox.js - About 1 hr to fix

                      Function bot_config_defaults has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def bot_config_defaults(config: object) -> None:
                          if not hasattr(config, "ACCESS_CONTROLS_DEFAULT"):
                              config.ACCESS_CONTROLS_DEFAULT = {}
                          if not hasattr(config, "ACCESS_CONTROLS"):
                              config.ACCESS_CONTROLS = {}
                      Severity: Minor
                      Found in errbot/bootstrap.py - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language