mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Consider simplifying this complex logical expression.
Open

            if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) {
                // unsorted select options
                return arry;
            } else {
                len = arry.length;
Severity: Major
Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                    if ( ( ( e.which || e.button ) !== 1 && !type.match( ' ' + c.pointerClick + ' | sort | keyup ' ) ) ||
                        // allow pressing enter
                        ( type === ' keyup ' && e.which !== ts.keyCodes.enter ) ||
                        // allow triggering a click event (e.which is undefined) & ignore physical clicks
                        ( type.match( ' ' + c.pointerClick + ' ' ) && typeof e.which !== 'undefined' ) ) {
    Severity: Major
    Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                      if ( ( ( e.which || e.button ) !== 1 && !type.match( ' ' + c.pointerClick + ' | sort | keyup ' ) ) ||
                          // allow pressing enter
                          ( type === ' keyup ' && e.which !== ts.keyCodes.enter ) ||
                          // allow triggering a click event (e.which is undefined) & ignore physical clicks
                          ( type.match( ' ' + c.pointerClick + ' ' ) && typeof e.which !== 'undefined' ) ) {
      Severity: Major
      Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 1 hr to fix

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

        function adslight_notify_iteminfo(
            $category,
            $item_id
        ) {
            global $xoopsDB;
        Severity: Minor
        Found in include/notification.inc.php - 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 adslight_show has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        function adslight_show($options)
        {
            if (!class_exists(Helper::class)) {
                return [];
            }
        Severity: Minor
        Found in blocks/ads.php - 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 getObjects has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function &getObjects($criteria = null, $id_as_key = false, $as_object = true) //&getObjects(?\CriteriaElement $criteria = null, $id_as_key = false): array
            {
                $ret   = [];
                $limit = $start = 0;
                $sql   = 'SELECT * FROM ' . $this->db->prefix('adslight_pictures');
        Severity: Minor
        Found in class/PicturesHandler.php - 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function rcopy(string $src, string $dest): bool
            {
                // 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 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 convertOrderByIn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function convertOrderByIn($orderby): string
            {
                switch (\trim($orderby)) {
                    case 'titleA':
                        $orderby = 'title ASC';
        Severity: Minor
        Found in class/Utility.php - 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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function rmove(string $src, string $dest): bool
            {
                // 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 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function recurseCopy(string $src, string $dst): void
            {
                $dir = \opendir($src);
                //        @mkdir($dst);
                if (!@\mkdir($dst) && !\is_dir($dst)) {
        Severity: Minor
        Found in class/Common/FilesManagement.php - 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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
        Severity: Major
        Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 50 mins to fix

          Method setOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function setOrder(string $bid, string $title, string $weight, string $visible, string $side, string $bcachetime, ?array $bmodule = null): void
          Severity: Major
          Found in class/Common/Blocksadmin.php - About 50 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if ( Expr.relative[ tokens[j].type ] ) {
                                    break;
                                }
            Severity: Major
            Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if ( copyIsArray && !Array.isArray( src ) ) {
                                      clone = [];
                                  } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
                                      clone = {};
                                  } else {
              Severity: Major
              Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if ( rscriptType.test( node.type || "" ) &&
                                        !dataPriv.access( node, "globalEval" ) &&
                                        jQuery.contains( doc, node ) ) {
                
                                        if ( node.src && ( node.type || "" ).toLowerCase()  !== "module" ) {
                Severity: Major
                Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if ( nodeType === 9 ) {
                                          if ( (elem = context.getElementById( m )) ) {
                  
                                              // Support: IE, Opera, Webkit
                                              // TODO: identify versions
                  Severity: Major
                  Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for ( type in data.events ) {
                                                if ( special[ type ] ) {
                                                    jQuery.event.remove( elem, type );
                    
                                                // This is a shortcut to avoid jQuery.event.remove's overhead
                    Severity: Major
                    Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for ( match in context ) {
                      
                                                  // Properties of context are called as methods if possible
                                                  if ( isFunction( this[ match ] ) ) {
                                                      this[ match ]( context[ match ] );
                      Severity: Major
                      Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if ( restoreDisplay == null ) {
                                                display = style.display;
                                                restoreDisplay = display === "none" ? "" : display;
                                            }
                        Severity: Major
                        Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
                                                          return true;
                                                      }
                          Severity: Major
                          Found in assets/js/lightbox/js/lightbox-plus-jquery.js - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language