mambax7/moduleinstaller

View on GitHub

Showing 122 of 200 total issues

Function Enumerable has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

var Enumerable = (function () {
    function each(iterator, context) {
        try {
            this._each(iterator, context);
        } catch (e) {
Severity: Minor
Found in assets/js/prototype.js - About 2 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 matcherFromGroupMatchers has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function matcherFromGroupMatchers(elementMatchers, setMatchers) {
        var bySet = setMatchers.length > 0,
            byElement = elementMatchers.length > 0,
            superMatcher = function (seed, context, xml, results, outermost) {
                var elem, j, matcher,
Severity: Major
Found in assets/js/prototype.js - About 2 hrs to fix

    Method truncateHtml has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function truncateHtml(
            string  $text,
            ?int    $length = null,
            ?string $ending = null,
            ?bool   $exact = null,
    Severity: Major
    Found in class/Common/SysUtility.php - About 2 hrs to fix

      Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
              if (postFilter && !postFilter[expando]) {
                  postFilter = setMatcher(postFilter);
              }
              if (postFinder && !postFinder[expando]) {
      Severity: Major
      Found in assets/js/prototype.js - About 2 hrs to fix

        Function superMatcher has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    superMatcher = function (seed, context, xml, results, outermost) {
                        var elem, j, matcher,
                            matchedCount = 0,
                            i = "0",
                            unmatched = seed && [],
        Severity: Major
        Found in assets/js/prototype.js - About 2 hrs to fix

          Function deleteDirectory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function deleteDirectory($src)
              {
                  // Only continue if user is a 'global' Admin
                  if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                      return false;
          Severity: Minor
          Found in class/Common/FilesManagement.php - About 2 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 Serializers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Form.Element.Serializers = (function () {
              function input(element, value) {
                  switch (element.type.toLowerCase()) {
                      case 'checkbox':
                      case 'radio':
          Severity: Major
          Found in assets/js/prototype.js - About 2 hrs to fix

            Function CHILD has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        "CHILD": function (type, what, argument, first, last) {
                            var simple = type.slice(0, 3) !== "nth",
                                forward = type.slice(-4) !== "last",
                                ofType = what === "of-type";
            
            
            Severity: Major
            Found in assets/js/prototype.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                          if (forward && useCache) {
                                              outerCache = parent[expando] || (parent[expando] = {});
                                              cache = outerCache[type] || [];
                                              nodeIndex = cache[0] === dirruns && cache[1];
                                              diff = cache[0] === dirruns && cache[2];
              Severity: Critical
              Found in assets/js/prototype.js - About 2 hrs to fix

                Method xoops_module_update_moduleinstaller has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function xoops_module_update_moduleinstaller(\XoopsModule $module, $previousVersion = null)
                {
                    $moduleDirName      = \basename(\dirname(__DIR__));
                    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                
                
                Severity: Major
                Found in include/onupdate.php - About 2 hrs to fix

                  Function Str has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function Str(key, holder, stack) {
                          var value = holder[key];
                          if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
                              value = value.toJSON(key);
                          }
                  Severity: Major
                  Found in assets/js/prototype.js - About 2 hrs to fix

                    Function clonePosition has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function clonePosition(element, source, options) {
                            options = Object.extend({
                                setLeft: true,
                                setTop: true,
                                setWidth: true,
                    Severity: Minor
                    Found in assets/js/prototype.js - About 2 hrs to fix

                      Function setRequestHeaders has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                          setRequestHeaders: function () {
                              var headers = {
                                  'X-Requested-With': 'XMLHttpRequest',
                                  'X-Prototype-Version': Prototype.Version,
                                  'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
                      Severity: Minor
                      Found in assets/js/prototype.js - 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 request has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                          request: function (url) {
                              this.url = url;
                              this.method = this.options.method;
                              var params = Object.isString(this.options.parameters) ?
                                  this.options.parameters :
                      Severity: Minor
                      Found in assets/js/prototype.js - 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 select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          select = Sizzle.select = function (selector, context, results, seed) {
                              var i, tokens, token, type, find,
                                  compiled = typeof selector === "function" && selector,
                                  match = !seed && tokenize((selector = compiled.selector || selector));
                      
                      
                      Severity: Minor
                      Found in assets/js/prototype.js - About 1 hr to fix

                        Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function tokenize(selector, parseOnly) {
                                var matched, match, tokens, type,
                                    soFar, groups, preFilters,
                                    cached = tokenCache[selector + " "];
                        
                        
                        Severity: Minor
                        Found in assets/js/prototype.js - About 1 hr to fix

                          Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function matcherFromTokens(tokens) {
                                  var checkContext, matcher, j,
                                      len = tokens.length,
                                      leadingRelative = Expr.relative[tokens[0].type],
                                      implicitRelative = leadingRelative || Expr.relative[" "],
                          Severity: Minor
                          Found in assets/js/prototype.js - About 1 hr to fix

                            Function getPixelValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function getPixelValue(value, property, context) {
                                    var element = null;
                                    if (Object.isElement(value)) {
                                        element = value;
                                        value = getRawStyle(element, property);
                            Severity: Minor
                            Found in assets/js/prototype.js - About 1 hr to fix

                              Function _begin has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      _begin: function () {
                                          if (this._isPrepared()) return;
                              
                                          var element = this.element;
                                          if (isDisplayed(element)) {
                              Severity: Minor
                              Found in assets/js/prototype.js - About 1 hr to fix

                                Function findDOMClass has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function findDOMClass(tagName) {
                                        var klass;
                                        var trans = {
                                            "OPTGROUP": "OptGroup",
                                            "TEXTAREA": "TextArea",
                                Severity: Minor
                                Found in assets/js/prototype.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language