mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

    protected static function _parseShortOption($arg, $short_options, &$opts, &$argIdx, $args, $skip_unknown)
Severity: Minor
Found in class/pear/Console/Getopt.php - About 45 mins to fix

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

        public function add_or_update_or_delete_meta($post_id, $name, $value)
        {
            $key = 'ml-slider_' . $name;
    
            if ('false' === $value || '' === $value || !$value) {
    Severity: Minor
    Found in assets/js/ml-slider/inc/slide/metaslide.class.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 _parseArgs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function _parseArgs($argv, $short_options, $long_options = null)
        {
            if (!is_array($argv) && null !== $argv) {
                /*
                // Quote all items that are a short option
    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

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

        function PclTarHandleAppend($p_tarname, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
    Severity: Minor
    Found in class/pcltar.lib.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ('/' === mb_substr($v_header['filename'], mb_strlen($p_file_list[$i]), 1)) {
                                  TrFctMessage(__FILE__, __LINE__, 3, '' . $v_header['filename'] . " is a file in $p_file_list[$i]");
                                  $v_delete_file = true;
                              }
      Severity: Major
      Found in class/pcltar.lib.php - About 45 mins to fix

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

            public function get_image_url()
            {
                // Get the image file path
                if (!mb_strlen($this->path)) {
                    return $this->url;
        Severity: Minor
        Found in assets/js/ml-slider/inc/metaslider.imagehelper.class.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 _setErrorHandling has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected static function _setErrorHandling(
                $object,
                $mode = null,
                $options = null
            ) {
        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 PclTarHandleAddList has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function PclTarHandleAddList($p_tar, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
        Severity: Minor
        Found in class/pcltar.lib.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ($helper->getConfig('album_tooltip_width') != $_POST['album_tooltip_width']) {
                                  $criteria = new \CriteriaCompo();
                                  $criteria->add($moduleIdCriteria);
                                  $criteria->add(new \Criteria('conf_name', 'album_tooltip_width'));
                                  /** @var \XoopsObject $config */
          Severity: Major
          Found in admin/album.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (!isset($args[++$argIdx])) {
                                        $msg = "Console_Getopt: option requires an argument --$opt";
                                        return PEAR::raiseError($msg);
                                    }
            Severity: Major
            Found in class/pear/Console/Getopt.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (preg_match('/.*ttf/', mb_strtolower($f))) {
                                          $fonts[] = $f;
                                      }
              Severity: Major
              Found in admin/watermark-border.php - About 45 mins to fix

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

                    function PclTarHandleUpdate($p_tarname, $p_file_list, &$p_list_detail, $p_tar_mode, $p_add_dir, $p_remove_dir)
                Severity: Minor
                Found in class/pcltar.lib.php - About 45 mins to fix

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

                      function setOrder($bid, $title, $weight, $visible, $side, $bcachetime)
                  Severity: Minor
                  Found in admin/blocksadmin.php - About 45 mins to fix

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

                        public function getList(CriteriaElement $criteria = null, $limit = 0, $start = 0)
                        {
                            $ret = [];
                            if (null === $criteria) {
                                $criteria = new CriteriaCompo();
                    Severity: Minor
                    Found in class/ModelReadIterator.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 imageMagickSupportType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function imageMagickSupportType()
                    {
                        /** @var Extgallery\Helper $helper */
                        $helper = Extgallery\Helper::getInstance();
                    
                    
                    Severity: Minor
                    Found in admin/main.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 dskspace has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function dskspace($dir)
                    {
                        $s     = stat($dir);
                        $space = $s[7];
                        if (is_dir($dir)) {
                    Severity: Minor
                    Found in admin/main.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

                    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

                      Severity
                      Category
                      Status
                      Source
                      Language