mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Avoid deeply nested control flow statements.
Open

                        if ($helper->getConfig('watermark_text') != $_POST['watermark_text']) {
                            $criteria = new \CriteriaCompo();
                            $criteria->add($moduleIdCriteria);
                            $criteria->add(new \Criteria('conf_name', 'watermark_text'));
                            $config      = $configHandler->getConfigs($criteria);
Severity: Major
Found in admin/watermark-border.php - About 45 mins to fix

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

        public static function loadExtension($ext)
        {
            if (extension_loaded($ext)) {
                return true;
            }
    Severity: Minor
    Found in class/pear/PEAR.php - 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 _multipleToStruct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected static function _multipleToStruct($files)
        {
            $struct = ['dirs' => [], 'files' => []];
            $files  = (array)$files;
            foreach ($files as $file) {
    Severity: Minor
    Found in class/pear/System.php - 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 toString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function toString()
        {
            $modes  = [];
            $levels = [
                E_USER_NOTICE  => 'notice',
    Severity: Minor
    Found in class/pear/PEAR.php - 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

    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function __construct($title, $modid, $permname, $permdesc, $url = '', $anonymous = true)
    Severity: Minor
    Found in class/GroupPermForm.php - About 45 mins to fix

      Method addLocalPhoto has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $catId,
              $dirtyPhotoName,
              $photoTitle = '',
              $photoDesc = '',
              $photoExtra = '',
      Severity: Minor
      Found in class/PhotoHandler.php - About 45 mins to fix

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

            public function getCatRestrictCriteria($permType = 'public_access')
            {
                if (null !== $GLOBALS['xoopsUser'] && \is_object($GLOBALS['xoopsUser'])) {
                    $permHandler       = $this->getPermHandler();
                    $allowedCategories = $permHandler->getAuthorizedPublicCat($GLOBALS['xoopsUser'], $permType);
        Severity: Minor
        Found in class/CategoryHandler.php - 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

        Consider simplifying this complex logical expression.
        Open

                            } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
                                e.preventDefault();
                                $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
                            }
        Severity: Major
        Found in assets/js/fancybox/fancybox.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if ('' != $opt_rest && '=' != $opt[0]
                          && $i + 1 < count($long_options)
                          && $opt == substr($long_options[$i + 1], 0, $opt_len)
                          && '' != $next_option_rest
                          && '=' != $next_option_rest[0]) {
          Severity: Major
          Found in class/pear/Console/Getopt.php - About 40 mins to fix

            Function galleria has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                galleria: function (_, t, b, c, d) {
            Severity: Minor
            Found in assets/js/galleria/galleria-1.3.5.js - About 35 mins to fix

              Function complete has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      var complete = (function( data, next, active, queue, thumb ) {
              Severity: Minor
              Found in assets/js/galleria/galleria-1.3.3.js - About 35 mins to fix

                Function galleria has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    galleria: function (_, t, b, c, d) {
                Severity: Minor
                Found in assets/js/galleria/galleria-1.3.3.js - About 35 mins to fix

                  Function galleria has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      galleria: function (_, t, b, c, d) {
                  Severity: Minor
                  Found in assets/js/galleria/galleria-1.1.js - About 35 mins to fix

                    Function complete has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            var complete = (function( data, next, active, queue, thumb ) {
                    Severity: Minor
                    Found in assets/js/galleria/galleria-1.3.5.js - About 35 mins to fix

                      Function easing has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                                  easing: function(x,t,b,c,d) {
                      Severity: Minor
                      Found in assets/js/galleria/galleria-1.3.3.js - About 35 mins to fix

                        Function easeout has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                this.easeout = function (x, t, b, c, d) {
                        Severity: Minor
                        Found in assets/js/galleria/galleria-1.3.3.js - About 35 mins to fix

                          Function easeInQuad has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              easeInQuad: function (x, t, b, c, d) {
                          Severity: Minor
                          Found in assets/js/galleryview/easing.js - About 35 mins to fix

                            Function galleriaOut has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                galleriaOut: function (_, t, b, c, d) {
                            Severity: Minor
                            Found in assets/js/galleria/galleria-1.3.3.js - About 35 mins to fix

                              Function easeOutQuad has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  easeOutQuad: function (x, t, b, c, d) {
                              Severity: Minor
                              Found in assets/js/galleryview/easing.js - About 35 mins to fix

                                Function galleriaIn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    galleriaIn: function (_, t, b, c, d) {
                                Severity: Minor
                                Found in assets/js/galleria/galleria-1.1.js - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language