mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

        if ( options.carousel ) {
            var count = 0,
                show = options.show;
            this.bind( Galleria.THUMBNAIL, function() {
                this.updateCarousel();
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 4 hrs to fix
assets/js/galleria/galleria-1.3.5.js on lines 3079..3088

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

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

    _run : function() {

        var self = this;

        self._createThumbnails();
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js - About 3 hrs to fix

    Function _run has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _run : function() {
    
            var self = this;
    
            self._createThumbnails();
    Severity: Major
    Found in assets/js/galleria/galleria-1.3.5.js - About 3 hrs to fix

      Function render_admin_page has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          public function render_admin_page()
          {
              $this->admin_process();
              $this->go_pro_cta();
              $this->system_check();
      Severity: Minor
      Found in assets/js/ml-slider/ml-slider.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

      File CategoryHandler.php has 329 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace XoopsModules\Extgallery;
      
      /**
      Severity: Minor
      Found in class/CategoryHandler.php - About 3 hrs to fix

        Function buildPanels has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function buildPanels() {
                    // If panel overlay content exists, add the necessary overlay background DIV
                    // The overlay content and background are separate elements so the background's opacity isn't inherited by the content
                    j_panels.each(function(i){
                        if($('.panel-overlay',this).length>0) {
        Severity: Major
        Found in assets/js/galleryview/galleryview.js - About 3 hrs to fix

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

                      $.each({
                              box: 'shadow content close prevholder nextholder',
                              info: 'title counter',
                              content: 'info image',
                              prevholder: 'prev',
          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 2208..2220

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

          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

                      self.rescale(function() {
          
                          self.addTimer(false, function() {
                              // show the image after 50 ms
                              if ( inBrowser ) {
          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 1842..1858

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

          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

                      $.each({
                              box: 'shadow content close prevholder nextholder',
                              info: 'title counter',
                              content: 'info image',
                              prevholder: 'prev',
          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 2218..2230

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

          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

                      self.rescale(function() {
          
                          self.addTimer(false, function() {
                              // show the image after 50 ms
                              if ( inBrowser ) {
          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 1847..1863

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

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

              scale: function( options ) {
          
                  // extend some defaults
                  options = $.extend({
                      width: 0,
          Severity: Major
          Found in assets/js/galleria/galleria-1.1.js - About 3 hrs to fix

            `` has 31 functions (exceeds 20 allowed). Consider refactoring.
            Open

            {
                def: 'easeOutQuad',
                swing: function (x, t, b, c, d) {
                    //alert(jQuery.easing.default);
                    return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
            Severity: Minor
            Found in assets/js/galleryview/easing.js - About 3 hrs to fix

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

                  function load () {
                      var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
              
                      active = true;
              
              
              Severity: Major
              Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 3 hrs to fix

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

                                $('<img />').addClass('nav-next').attr('src',theme_path+opts.nav_theme+'/next.png').appendTo(j_gallery).css({
                                    'position':'absolute',
                                    'zIndex':'1100',
                                    'cursor':'pointer',
                                    'top':((opts.panel_height-22)/2)+gallery_padding+'px',
                Severity: Major
                Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
                assets/js/galleryview/galleryview.js on lines 392..399

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

                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

                                $('<img />').addClass('nav-prev').attr('src',theme_path+opts.nav_theme+'/prev.png').appendTo(j_gallery).css({
                                    'position':'absolute',
                                    'zIndex':'1100',
                                    'cursor':'pointer',
                                    'top':((opts.panel_height-22)/2)+gallery_padding+'px',
                Severity: Major
                Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
                assets/js/galleryview/galleryview.js on lines 384..391

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

                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 doGetopt has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false)
                    {
                        // in case you pass directly readPHPArgv() as the first arg
                        if (PEAR::isError($args)) {
                            return $args;
                Severity: Minor
                Found in class/pear/Console/Getopt.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

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

                                navNext.css({
                                    'top':(opts.filmstrip_position=='top'?Math.max(gallery_padding,filmstrip_margin):opts.panel_height+filmstrip_margin+gallery_padding)+((f_frame_height-22)/2)+'px',
                                    'right':((gallery_width+(gallery_padding*2))/2)-(wrapper_width/2)-opts.frame_gap-22+'px'
                                });
                Severity: Major
                Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
                assets/js/galleryview/galleryview.js on lines 676..679

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

                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

                        $.each( ['info','counter','image-nav'], function( i, el ) {
                            if ( options[ 'show' + el.substr(0,1).toUpperCase() + el.substr(1).replace(/-/,'') ] === false ) {
                                Utils.moveOut( self.get( el.toLowerCase() ) );
                            }
                        });
                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 3037..3041

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

                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

                                navPrev.css({
                                    'top':(opts.filmstrip_position=='top'?Math.max(gallery_padding,filmstrip_margin):opts.panel_height+filmstrip_margin+gallery_padding)+((f_frame_height-22)/2)+'px',
                                    'left':((gallery_width+(gallery_padding*2))/2)-(wrapper_width/2)-opts.frame_gap-22+'px'
                                 });
                Severity: Major
                Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
                assets/js/galleryview/galleryview.js on lines 672..675

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

                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

                        $.each( ['info','counter','image-nav'], function( i, el ) {
                            if ( options[ 'show' + el.substr(0,1).toUpperCase() + el.substr(1).replace(/-/,'') ] === false ) {
                                Utils.moveOut( self.get( el.toLowerCase() ) );
                            }
                        });
                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 3055..3059

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

                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

                Severity
                Category
                Status
                Source
                Language