errbotio/errbot

View on GitHub

Showing 155 of 224 total issues

File jquery.fancybox.js has 1458 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * fancyBox - jQuery Plugin
 * version: 2.1.5 (Fri, 14 Jun 2013)
 * @requires jQuery v1.6 or later
 *
Severity: Major
Found in docs/_static/fancybox/jquery.fancybox.js - About 3 days to fix

    File base.py has 808 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import io
    import logging
    import random
    import time
    from abc import ABC, abstractmethod
    Severity: Major
    Found in errbot/backends/base.py - About 1 day to fix

      File irc.py has 720 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from __future__ import absolute_import
      
      import logging
      import re
      import struct
      Severity: Major
      Found in errbot/backends/irc.py - About 1 day to fix

        File botplugin.py has 705 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import logging
        import re
        import shlex
        from io import IOBase
        from threading import Timer, current_thread
        Severity: Major
        Found in errbot/botplugin.py - About 1 day to fix

          File core.py has 702 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #    This program is free software; you can redistribute it and/or modify
          #    it under the terms of the GNU General Public License as published by
          #    the Free Software Foundation; either version 3 of the License, or
          #    (at your option) any later version.
          #
          Severity: Major
          Found in errbot/core.py - About 1 day to fix

            File xmpp.py has 571 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            from __future__ import annotations
            
            import logging
            import sys
            from datetime import datetime
            Severity: Major
            Found in errbot/backends/xmpp.py - About 1 day to fix

              File test.py has 561 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import importlib
              import logging
              import sys
              import textwrap
              import unittest
              Severity: Major
              Found in errbot/backends/test.py - About 1 day to fix

                Function help has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                Open

                    def help(self, msg, args):
                        """Returns a help string listing available options.
                        Automatically assigned to the "help" command."""
                
                        def may_access_command(m, cmd):
                Severity: Minor
                Found in errbot/core_plugins/help.py - About 1 day 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 plugin_manager.py has 531 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """ Logic related to plugin loading and lifecycle """
                
                import logging
                import os
                import subprocess
                Severity: Major
                Found in errbot/plugin_manager.py - About 1 day to fix

                  File __init__.py has 494 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import argparse
                  import inspect
                  import logging
                  import re
                  import shlex
                  Severity: Minor
                  Found in errbot/__init__.py - About 7 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                                if (a && (f.isPlainObject(d) || (d = {}), !1 !== b.close(!0)))return f.isArray(a) || (a = t(a) ? f(a).get() : [a]), f.each(a, function (e, c) {
                                    var k = {}, g, h, j, m, l;
                                    "object" === f.type(c) && (c.nodeType && (c = f(c)), t(c) ? (k = {href: c.data("fancybox-href") || c.attr("href"), title: c.data("fancybox-title") || c.attr("title"), isDom: !0, element: c}, f.metadata && f.extend(!0, k,
                                        c.metadata())) : k = c);
                                    g = d.href || k.href || (q(c) ? c : null);
                    Severity: Critical
                    Found in docs/_static/fancybox/jquery.fancybox.pack.js - About 7 hrs to fix

                      File ansiext.py has 470 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import io
                      import logging
                      from collections import namedtuple
                      from functools import partial
                      from html import unescape
                      Severity: Minor
                      Found in errbot/rendering/ansiext.py - About 7 hrs to fix

                        File jquery.fancybox.pack.js has 466 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
                        (function (r, G, f, v) {
                            var J = f("html"), n = f(r), p = f(G), b = f.fancybox = function () {
                                b.open.apply(this, arguments)
                            }, I = navigator.userAgent.match(/msie/i), B = null, s = G.createTouch !== v, t = function (a) {
                        Severity: Minor
                        Found in docs/_static/fancybox/jquery.fancybox.pack.js - About 7 hrs to fix

                          Function recurse has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def recurse(write, chr_table, element, table=None, borders=True):
                              post_element = []
                              if element.text:
                                  text = element.text
                              else:
                          Severity: Minor
                          Found in errbot/rendering/ansiext.py - About 6 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 _setDimension has 168 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  _setDimension: function () {
                                      var viewport = F.getViewport(),
                                          steps = 0,
                                          canShrink = false,
                                          canExpand = false,
                          Severity: Major
                          Found in docs/_static/fancybox/jquery.fancybox.js - About 6 hrs to fix

                            File flow.py has 417 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import atexit
                            import logging
                            from multiprocessing.pool import ThreadPool
                            from threading import RLock
                            from typing import Any, Callable, List, Mapping, Optional, Tuple, Union
                            Severity: Minor
                            Found in errbot/flow.py - About 6 hrs to fix

                              File telegram_messenger.py has 416 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import logging
                              import sys
                              from typing import Any, BinaryIO, List, Optional, Union
                              
                              from errbot.backends.base import (
                              Severity: Minor
                              Found in errbot/backends/telegram_messenger.py - About 6 hrs to fix

                                Function __str__ has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def __str__(self):
                                        nbcols = max(len(row) for row in chain(self.headers, self.rows))
                                        maxes = [
                                            0,
                                        ] * nbcols
                                Severity: Minor
                                Found in errbot/rendering/ansiext.py - About 5 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 text.py has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import copyreg
                                import logging
                                import re
                                import sys
                                from time import sleep
                                Severity: Minor
                                Found in errbot/backends/text.py - About 5 hrs to fix

                                  Function arg_botcmd has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def arg_botcmd(
                                      *args,
                                      hidden: bool = None,
                                      name: str = None,
                                      admin_only: bool = False,
                                  Severity: Minor
                                  Found in errbot/__init__.py - About 5 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language