errbotio/errbot

View on GitHub

Showing 155 of 224 total issues

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

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

    Consider simplifying this complex logical expression.
    Open

                if (a && !1 !== b.isActive)if (!1 === b.trigger("afterLoad", a, d))a.wrap.stop(!0).trigger("onReset").remove(), b.coming = null; else {
                    d && (b.trigger("beforeChange", d), d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());
                    b.unbindEvents();
                    e = a.content;
                    c = a.type;
    Severity: Major
    Found in docs/_static/fancybox/jquery.fancybox.pack.js - About 1 hr to fix

      Function _load_plugins_generic has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Consider simplifying this complex logical expression.
        Open

                    if (h.fitToView)if (g.width(c).height(j), e.width(c + x), a = e.width(), y = e.height(), h.aspectRatio)for (; (a > z || y > r) && (c > m && j > u) && !(19 < d++);)j = Math.max(u, Math.min(p, j - 10)), c = l(j * D), c < m && (c = m, j = l(c / D)), c > n && (c = n, j = l(c / D)), g.width(c).height(j), e.width(c + x), a = e.width(), y = e.height(); else c = Math.max(m, Math.min(c, c - (a - z))), j = Math.max(u, Math.min(j, j - (y - r)));
        Severity: Major
        Found in docs/_static/fancybox/jquery.fancybox.pack.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                              if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
                                  $.each(keys, function (i, val) {
                                      if (current.group.length > 1 && val[ code ] !== undefined) {
                                          F[ i ](val[ code ]);
          
          
          Severity: Major
          Found in docs/_static/fancybox/jquery.fancybox.js - About 1 hr to fix

            Function version2tuple has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def version2tuple(version: str) -> Tuple:
                vsplit = version.split("-")
            
                if len(vsplit) == 2:
                    main, sub = vsplit
            Severity: Minor
            Found in errbot/utils.py - About 55 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 serve_forever has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def serve_forever(self) -> None:
                    """
                    Connect the back-end to the server and serve forever.
            
                    Back-ends MAY choose to re-implement this method, in which case
            Severity: Minor
            Found in errbot/backends/base.py - About 55 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 send_stream_request has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def send_stream_request(
                    self,
                    identifier: Union[TelegramPerson, TelegramMUCOccupant],
                    fsource: Union[str, dict, BinaryIO],
                    name: Optional[str] = "file",
            Severity: Minor
            Found in errbot/backends/telegram_messenger.py - About 55 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 search_repos has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def search_repos(self, query: str) -> Generator[RepoEntry, None, None]:
                    """
                    A simple search feature, keywords are AND and case insensitive on all the fields.
            
                    :param query: a string query
            Severity: Minor
            Found in errbot/repo_manager.py - About 55 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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in errbot/plugin_manager.py - About 50 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in errbot/backend_plugin_manager.py - About 45 mins to fix

                Function send_templated has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def send_templated(
                Severity: Minor
                Found in errbot/botplugin.py - About 45 mins to fix

                  Function program_next_poll has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def program_next_poll(
                  Severity: Minor
                  Found in errbot/botplugin.py - About 45 mins to fix

                    Function send_stream_request has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def send_stream_request(
                    Severity: Minor
                    Found in errbot/botplugin.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if not may_access_command(msg, name):
                                                  continue
                                          pairs.append((name, command))
                      Severity: Major
                      Found in errbot/core_plugins/help.py - About 45 mins to fix

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

                            def __init__(
                        Severity: Minor
                        Found in errbot/botplugin.py - About 45 mins to fix

                          Function send_templated has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def send_templated(
                          Severity: Minor
                          Found in errbot/core.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for flow in self._bot.flow_executor.in_flight:
                                                        if self.check_user(msg, flow):
                                                            next_steps = [
                                                                f"\\*{str(step[1].command)}\\*"
                                                                for step in flow._current_step.children
                            Severity: Major
                            Found in errbot/core_plugins/flows.py - About 45 mins to fix

                              Function main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def main():
                                  find_plugins("err")
                                  # Those are found by global search only available on github UI:
                                  # https://github.com/search?l=&q=Documentation+extension%3Aplug&ref=advsearch&type=Code&utf8=%E2%9C%93
                                  url = "https://api.github.com/repos/%s"
                              Severity: Minor
                              Found in tools/plugin-gen.py - About 45 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 start_poller has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def start_poller(
                              Severity: Minor
                              Found in errbot/botplugin.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language