mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

The class PEAR has an overall complexity of 104 which is very high. The configured complexity threshold is 50.
Open

class PEAR
{
    /**
     * Whether to enable internal debug messages.
     *
Severity: Minor
Found in class/pear/PEAR.php by phpmd

The class System has an overall complexity of 114 which is very high. The configured complexity threshold is 50.
Open

class System
{
    /**
     * returns the commandline arguments of a function
     *
Severity: Minor
Found in class/pear/System.php by phpmd

Function show has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        show: function(index) {

            lightbox.active = index = typeof index === 'number' ? index : self.getIndex() || 0;

            if ( !lightbox.initialized ) {
Severity: Major
Found in assets/js/galleria/galleria-1.3.5.js - About 3 hrs to fix

    Function success has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                success: function() {
    
                    // calculate some cropping
                    var newWidth = ( width - options.margin * 2 ) / self.original.width,
                        newHeight = ( height - options.margin * 2 ) / self.original.height,
    Severity: Major
    Found in assets/js/galleria/galleria-1.3.5.js - About 3 hrs to fix

      Function success has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  success: function() {
      
                      // calculate some cropping
                      var newWidth = ( width - options.margin * 2 ) / self.original.width,
                          newHeight = ( height - options.margin * 2 ) / self.original.height,
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.3.js - About 3 hrs to fix

        Function show has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                show: function(index) {
        
                    lightbox.active = index = typeof index === 'number' ? index : self.getIndex() || 0;
        
                    if ( !lightbox.initialized ) {
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.3.js - About 3 hrs to fix

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

              public function getUserAlbumPrevPhoto($userId, $photoDate)
              {
                  $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
          
                  $criteria = new CriteriaCompo();
          Severity: Major
          Found in class/PublicPhotoHandler.php and 3 other locations - About 3 hrs to fix
          class/PhotoHandler.php on lines 245..259
          class/PhotoHandler.php on lines 267..281
          class/PublicPhotoHandler.php on lines 138..152

          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 148.

          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 4 locations. Consider refactoring.
          Open

              public function getUserAlbumNextPhoto($userId, $photoDate)
              {
                  $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
          
                  $criteria = new CriteriaCompo();
          Severity: Major
          Found in class/PublicPhotoHandler.php and 3 other locations - About 3 hrs to fix
          class/PhotoHandler.php on lines 245..259
          class/PhotoHandler.php on lines 267..281
          class/PublicPhotoHandler.php on lines 116..130

          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 148.

          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 4 locations. Consider refactoring.
          Open

              public function getAlbumPrevPhoto($catId, $photoId)
              {
                  $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
          
                  $criteria = new CriteriaCompo();
          Severity: Major
          Found in class/PhotoHandler.php and 3 other locations - About 3 hrs to fix
          class/PhotoHandler.php on lines 267..281
          class/PublicPhotoHandler.php on lines 116..130
          class/PublicPhotoHandler.php on lines 138..152

          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 148.

          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 4 locations. Consider refactoring.
          Open

              public function getAlbumNextPhoto($catId, $photoId)
              {
                  $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
          
                  $criteria = new CriteriaCompo();
          Severity: Major
          Found in class/PhotoHandler.php and 3 other locations - About 3 hrs to fix
          class/PhotoHandler.php on lines 245..259
          class/PublicPhotoHandler.php on lines 116..130
          class/PublicPhotoHandler.php on lines 138..152

          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 148.

          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

          if ( typeof module === "object" && module && typeof module.exports === "object" ) {
              module.exports = Galleria;
          } else {
              window.Galleria = Galleria;
              if ( typeof define === "function" && define.amd ) {
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 3 hrs to fix
          assets/js/galleria/galleria-1.3.5.js on lines 6851..6858

          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 101.

          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

          if ( typeof module === "object" && module && typeof module.exports === "object" ) {
              module.exports = Galleria;
          } else {
              window.Galleria = Galleria;
              if ( typeof define === "function" && define.amd ) {
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 3 hrs to fix
          assets/js/galleria/galleria-1.3.3.js on lines 6827..6834

          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 101.

          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 resize has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.resize = function($img,mode,o){
                  var maxW = 0;
                  var maxH = 0;
                  if(mode == 'single'){
                      switch(o.size){
          Severity: Major
          Found in assets/js/microgallery/jquery.microgallery.js - About 3 hrs to fix

            Function find has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function find($args)
                {
                    if (!is_array($args)) {
                        $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY);
                    }
            Severity: Minor
            Found in class/pear/System.php - About 3 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 PclTarHandleHeader has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTarHandleHeader($p_tar, $p_filename, $p_mode, &$p_header, $p_stored_filename)
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarHandleHeader', "tar=$p_tar, file='$p_filename', mode='$p_mode', stored_filename='$p_stored_filename'");
                    $v_result = 1;
            
            
            Severity: Minor
            Found in class/pcltar.lib.php - About 3 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 PclTarHandleCreate has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTarHandleCreate($p_tarname, $p_list, $p_mode, $p_add_dir = '', $p_remove_dir = '')
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarHandleCreate', "tar=$p_tarname, list, mode=$p_mode, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
                    $v_result      = 1;
                    $v_list_detail = [];
            Severity: Minor
            Found in class/pcltar.lib.php - About 3 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 factory has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                public function &factory($driver = '')
                {
                    if ('' == $driver) {
                        $extensions = [
                            'imagick' => 'Imagick3',
            Severity: Minor
            Found in class/pear/Image/Transform.php - About 3 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 TrDisplay has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                function TrDisplay()
                {
                    global $g_pcl_trace_level;
                    global $g_pcl_trace_mode;
                    global $g_pcl_trace_filename;
            Severity: Minor
            Found in class/pcltrace.lib.php - About 3 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

            Method PclTarHandleAppend has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function PclTarHandleAppend($p_tarname, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarHandleAppend', "tar=$p_tarname, list, mode=$p_mode");
                    $v_result = 1;
            
            
            Severity: Major
            Found in class/pcltar.lib.php - About 3 hrs to fix

              File NetPBM.php has 301 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /* vim: set expandtab tabstop=4 shiftwidth=4: */
              
              /**
              Severity: Minor
              Found in class/pear/Image/Transform/Driver/NetPBM.php - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language