myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js

Summary

Maintainability
D
2 days
Test Coverage

Function justifiedGallery has 180 lines of code (exceeds 25 allowed). Consider refactoring.
Open

   $.fn.justifiedGallery = function(options){

           //TODO fare impostazione 'rel' che sostituisce tutti i link con il rel specificato

        var settings = $.extend( {
Severity: Major
Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 7 hrs to fix

    Function processesImages has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function processesImages($, cont, images, lastRowWidth, settings){    
                var row = new Array();
                var row_i, i;
                var partialRowWidth = 0;
                var extraW;
    Severity: Minor
    Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 1 hr to fix

      Function buildImage has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              function buildImage(image, suffix, nw, nh, l, minRowHeight, settings){
      Severity: Major
      Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 50 mins to fix

        Function processesImages has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                function processesImages($, cont, images, lastRowWidth, settings){    
        Severity: Minor
        Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 35 mins to fix

          Function checkWidth has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  function checkWidth($, cont, images, lastRowWidth, settings){
          Severity: Minor
          Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 35 mins to fix

            Avoid too many return statements within this function.
            Open

                            return settings.sizeRangeSuffixes.lt640; //medium (longest side:640)
            Severity: Major
            Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return settings.sizeRangeSuffixes.lt1024; //large (longest side:1024)
              Severity: Major
              Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 30 mins to fix

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

                                $(cont).find(".jg-image").mouseenter(function(sender){
                                    $(sender.currentTarget).find(".jg-image-label").stop();
                                    $(sender.currentTarget).find(".jg-image-label").fadeTo(500, 0.7);
                                });
                myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js on lines 222..225

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

                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

                                $(cont).find(".jg-image").mouseleave(function(sender){
                                    $(sender.currentTarget).find(".jg-image-label").stop();
                                    $(sender.currentTarget).find(".jg-image-label").fadeTo(500, 0);
                                });
                myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js on lines 218..221

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

                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

                                images[index]["rel"] = (settings.rel != null) ? settings.rel : $(entry).attr("rel");
                myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js on lines 60..60

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

                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

                                images[index]["target"] = (settings.target != null) ? settings.target : $(entry).attr("target");
                myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js on lines 59..59

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

                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

                There are no issues that match your filters.

                Category
                Status