mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Method get_crop_dimensions has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function get_crop_dimensions($image_width, $image_height)
    {
        if ('false' === $this->smart_crop) {
            return ['width' => $this->container_width, 'height' => $this->container_height];
        }
Severity: Major
Found in assets/js/ml-slider/inc/metaslider.imagehelper.class.php - About 2 hrs to fix

    Function extgalleryPhotoShow has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    function extgalleryPhotoShow($options)
    {
        global $xoopsConfig;
        $photos = [];
    
    
    Severity: Minor
    Found in blocks/extgallery_blocks.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 checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function checkVerModule($helper, $source = 'github', $default = 'master')
        {
            $moduleDirName      = \basename(\dirname(__DIR__, 2));
            $moduleDirNameUpper = mb_strtoupper($moduleDirName);
            $update             = '';
    Severity: Minor
    Found in class/Common/VersionChecks.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 which has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function which($program, $fallback = false)
        {
            // enforce API
            if (!is_string($program) || '' == $program) {
                return $fallback;
    Severity: Minor
    Found in class/pear/System.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 rm has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function rm($args)
        {
            $opts = self::_parseArgs($args, 'rf'); // "f" does nothing but I like it :-)
            if (PEAR::isError($opts)) {
                return self::raiseError($opts);
    Severity: Minor
    Found in class/pear/System.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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            $cachetimes  = [
                0 => _NOCACHE,
                30 => sprintf(_SECONDS, 30),
                60 => _MINUTE,
                300 => sprintf(_MINUTES, 5),
    Severity: Major
    Found in admin/blocksadmin.php and 1 other location - About 2 hrs to fix
    admin/blockform.php on lines 86..98

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 140.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        [
            0       => _NOCACHE,
            30      => sprintf(_SECONDS, 30),
            60      => _MINUTE,
            300     => sprintf(_MINUTES, 5),
    Severity: Major
    Found in admin/blockform.php and 1 other location - About 2 hrs to fix
    admin/blocksadmin.php on lines 112..124

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 140.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function position has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        publicMethod.position = function (speed, loadedCallback) {
            var
            css,
            top = 0,
            left = 0,
    Severity: Major
    Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 2 hrs to fix

      Method PclTarHandleExtractByIndex has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function PclTarHandleExtractByIndex(
              $p_tar,
              &$p_index_current,
              $p_index_start,
              $p_index_stop,
      Severity: Major
      Found in class/pcltar.lib.php - About 2 hrs to fix

        Method TrDisplay has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function TrDisplay()
            {
                global $g_pcl_trace_level;
                global $g_pcl_trace_mode;
                global $g_pcl_trace_filename;
        Severity: Major
        Found in class/pcltrace.lib.php - About 2 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public function getAlbumCurrentPhotoPlace($catId, $photoId)
              {
                  $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
          
                  $criteria = new CriteriaCompo();
          Severity: Major
          Found in class/PhotoHandler.php and 1 other location - About 2 hrs to fix
          class/PublicPhotoHandler.php on lines 160..173

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 139.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public function getUserAlbumCurrentPhotoPlace($userId, $photoDate)
              {
                  $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
          
                  $criteria = new CriteriaCompo();
          Severity: Major
          Found in class/PublicPhotoHandler.php and 1 other location - About 2 hrs to fix
          class/PhotoHandler.php on lines 289..302

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 139.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                              if(mode == 'single'){
                                  $current    = $('.images div:nth-child('+current+')',$this);
                                  $prev       = $current.prev();
                                  if($prev.length){
                                      $current.hide();
          Severity: Major
          Found in assets/js/microgallery/jquery.microgallery.js and 1 other location - About 2 hrs to fix
          assets/js/microgallery/jquery.microgallery.js on lines 23..44

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      self.rescale(function() {
                          Utils.addTimer('fullscreen_exit', function() {
          
                              // show the image after 50 ms
                              Utils.show( self.getActiveImage() );
          Severity: Major
          Found in assets/js/galleria/galleria-1.1.js and 1 other location - About 2 hrs to fix
          assets/js/galleria/galleria-1.1.js on lines 945..958

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          Galleria.ready = function( fn ) {
              if ( typeof fn != 'function' ) {
                  return Galleria;
              }
              $.each( _galleries, function( i, gallery ) {
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 2 hrs to fix
          assets/js/galleria/galleria-1.3.5.js on lines 5928..5937

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                              if(mode == 'single'){
                                  $current    = $('.images div:nth-child('+current+')',$this);
                                  $next       = $current.next();
                                  if($next.length){
                                      $current.hide();
          Severity: Major
          Found in assets/js/microgallery/jquery.microgallery.js and 1 other location - About 2 hrs to fix
          assets/js/microgallery/jquery.microgallery.js on lines 49..68

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      self.rescale(function() {
          
                          Utils.addTimer('fullscreen_enter', function() {
                              // show the image after 50 ms
                              Utils.show( self.getActiveImage() );
          Severity: Major
          Found in assets/js/galleria/galleria-1.1.js and 1 other location - About 2 hrs to fix
          assets/js/galleria/galleria-1.1.js on lines 985..998

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          Galleria.ready = function( fn ) {
              if ( typeof fn != 'function' ) {
                  return Galleria;
              }
              $.each( _galleries, function( i, gallery ) {
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 2 hrs to fix
          assets/js/galleria/galleria-1.3.3.js on lines 5907..5916

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function load has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              load : function( source, selector, config ) {
          
                  var self = this,
                      o = this._options;
          
          
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js - About 2 hrs to fix

            Function load has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                load : function( source, selector, config ) {
            
                    var self = this,
                        o = this._options;
            
            
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language