mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

        remove: function(elem) {

            elem = $(elem);

            $.each(idle.trunk, function(i, el) {
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 6 hrs to fix
assets/js/galleria/galleria-1.3.5.js on lines 2022..2037

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

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

        remove: function(elem) {

            elem = $(elem);

            $.each(idle.trunk, function(i, el) {
Severity: Major
Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 6 hrs to fix
assets/js/galleria/galleria-1.3.3.js on lines 2017..2032

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

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

Method PclTarMerge has 154 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function PclTarMerge($p_tarname, $p_tarname_add, $p_mode = '', $p_mode_add = '')
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarMerge', "tar='$p_tarname', tar_add='$p_tarname_add', mode='$p_mode', mode_add='$p_mode_add'");
        $v_result = 1;

Severity: Major
Found in class/pcltar.lib.php - About 6 hrs to fix

    Function scale has 152 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        scale: function( options ) {
    
            var self = this;
    
            // extend some defaults
    Severity: Major
    Found in assets/js/galleria/galleria-1.3.3.js - About 6 hrs to fix

      Function scale has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          scale: function( options ) {
      
              var self = this;
      
              // extend some defaults
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.5.js - About 6 hrs to fix

        Method extgalleryPhotoShow has 149 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function extgalleryPhotoShow($options)
        {
            global $xoopsConfig;
            $photos = [];
        
        
        Severity: Major
        Found in blocks/extgallery_blocks.php - About 5 hrs to fix

          File album.php has 415 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * ExtGallery Admin settings
           * Manage admin pages
           *
          Severity: Minor
          Found in admin/album.php - About 5 hrs to fix

            Function get_crop_dimensions has a Cognitive Complexity of 39 (exceeds 5 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: Minor
            Found in assets/js/ml-slider/inc/metaslider.imagehelper.class.php - About 5 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 build_settings_rows has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

                public function build_settings_rows($aFields)
                {
                    // order the fields by priority
                    uasort($aFields, [$this, 'compare_elems']);
            
            
            Severity: Minor
            Found in assets/js/ml-slider/ml-slider.php - About 5 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

            Galleria.log = function() {
                var args = Utils.array( arguments );
                if( 'console' in window && 'log' in window.console ) {
                    try {
                        return window.console.log.apply( window.console, args );
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 5 hrs to fix
            assets/js/galleria/galleria-1.3.3.js on lines 5883..5896

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

            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.log = function() {
                var args = Utils.array( arguments );
                if( 'console' in window && 'log' in window.console ) {
                    try {
                        return window.console.log.apply( window.console, args );
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 5 hrs to fix
            assets/js/galleria/galleria-1.3.5.js on lines 5904..5917

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

            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 PclTarHandleAppend has a Cognitive Complexity of 38 (exceeds 5 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: Minor
            Found in class/pcltar.lib.php - About 5 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 mkDir has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function mkDir($args)
                {
                    $opts = self::_parseArgs($args, 'pm:');
                    if (PEAR::isError($opts)) {
                        return self::raiseError($opts);
            Severity: Minor
            Found in class/pear/System.php - About 5 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

                    this.$( 'image-nav-right, image-nav-left' ).on( 'click:fast', function(e) {
            
                        // pause if options is set
                        if ( options.pauseOnInteraction ) {
                            self.pause();
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 5 hrs to fix
            assets/js/galleria/galleria-1.3.5.js on lines 3033..3052

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

            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

                    this.$( 'image-nav-right, image-nav-left' ).on( 'click:fast', function(e) {
            
                        // pause if options is set
                        if ( options.pauseOnInteraction ) {
                            self.pause();
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 5 hrs to fix
            assets/js/galleria/galleria-1.3.3.js on lines 3015..3034

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

            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

                setInfo : function( index ) {
            
                    var self = this,
                        data = this.getData( index );
            
            
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 5 hrs to fix
            assets/js/galleria/galleria-1.3.3.js on lines 5455..5472

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

            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

                setInfo : function( index ) {
            
                    var self = this,
                        data = this.getData( index );
            
            
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 5 hrs to fix
            assets/js/galleria/galleria-1.3.5.js on lines 5476..5493

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

            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

            Method extgalleryAjax has 142 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function extgalleryAjax($options)
            {
                $photos = [];
                /** @var Extgallery\PhotoHandler $photoHandler */
                $photoHandler       = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
            Severity: Major
            Found in blocks/extgallery_blocks.php - About 5 hrs to fix

              Function _enter has 136 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _enter: function( callback ) {
              
                          fullscreen.active = true;
              
                          if ( IFRAME ) {
              Severity: Major
              Found in assets/js/galleria/galleria-1.3.5.js - About 5 hrs to fix

                Method xoops_module_update_extgallery has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function xoops_module_update_extgallery(\XoopsModule $module, $previousVersion = null)
                {
                    global $xoopsDB;
                
                    $moduleDirName      = \basename(\dirname(__DIR__));
                Severity: Major
                Found in include/onupdate.php - About 5 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language