passy/angular-masonry

View on GitHub

Showing 22 of 22 total issues

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

  angular.module('wu.masonry', []).controller('MasonryCtrl', [
    '$scope',
    '$element',
    '$timeout',
    function controller($scope, $element, $timeout) {
Severity: Major
Found in angular-masonry.js and 1 other location - About 1 day to fix
src/angular-masonry.js on lines 12..207

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

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

  angular.module('wu.masonry', [])
    .controller('MasonryCtrl', function controller($scope, $element, $timeout) {
      var bricks = {};
      var schedule = [];
      var destroyed = false;
Severity: Major
Found in src/angular-masonry.js and 1 other location - About 1 day to fix
angular-masonry.js on lines 8..174

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

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

    .controller('MasonryCtrl', function controller($scope, $element, $timeout) {
      var bricks = {};
      var schedule = [];
      var destroyed = false;
      var self = this;
Severity: Major
Found in src/angular-masonry.js - About 3 hrs to fix

    Function exports has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      'use strict';
    
      var liveReloadPort = 35729;
    
    
    Severity: Major
    Found in Gruntfile.js - About 3 hrs to fix

      Function controller has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function controller($scope, $element, $timeout) {
            var bricks = {};
            var schedule = [];
            var destroyed = false;
            var self = this;
      Severity: Major
      Found in angular-masonry.js - About 3 hrs to fix

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

              this.scheduleMasonryOnce = function scheduleMasonryOnce() {
                var args = arguments;
                var found = schedule.filter(function filterFn(item) {
                    return item[0] === args[0];
                  }).length > 0;
        Severity: Major
        Found in angular-masonry.js and 1 other location - About 3 hrs to fix
        src/angular-masonry.js on lines 23..32

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

        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.scheduleMasonryOnce = function scheduleMasonryOnce() {
                var args = arguments;
                var found = schedule.filter(function filterFn(item) {
                  return item[0] === args[0];
                }).length > 0;
        Severity: Major
        Found in src/angular-masonry.js and 1 other location - About 3 hrs to fix
        angular-masonry.js on lines 20..28

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

        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 (reloadOnShow !== false && attrs.reloadOnShow !== undefined) {
                      scope.$watch(function () {
                        return element.prop('offsetParent');
                      }, function (isVisible, wasVisible) {
                        if (isVisible && !wasVisible) {
        Severity: Major
        Found in src/angular-masonry.js and 1 other location - About 2 hrs to fix
        angular-masonry.js on lines 124..132

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

        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 (reloadOnShow !== false && attrs.reloadOnShow !== undefined) {
                    scope.$watch(function () {
                      return element.prop('offsetParent');
                    }, function (isVisible, wasVisible) {
                      if (isVisible && !wasVisible) {
        Severity: Major
        Found in angular-masonry.js and 1 other location - About 2 hrs to fix
        src/angular-masonry.js on lines 152..160

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

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

            }).directive('masonry', function masonryDirective() {
              return {
                restrict: 'AE',
                controller: 'MasonryCtrl',
                controllerAs: 'msnry',
        Severity: Minor
        Found in src/angular-masonry.js - About 1 hr to fix

          Function masonryDirective has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            ]).directive('masonry', function masonryDirective() {
              return {
                restrict: 'AE',
                controller: 'MasonryCtrl',
                link: {
          Severity: Minor
          Found in angular-masonry.js - About 1 hr to fix

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

                        if (reloadOnResize !== false && attrs.reloadOnResize !== undefined) {
                          scope.$watch('masonryContainer.offsetWidth', function (newWidth, oldWidth) {
                            if (newWidth !== oldWidth) {
                              ctrl.reload();
                            }
            Severity: Major
            Found in src/angular-masonry.js and 1 other location - About 1 hr to fix
            angular-masonry.js on lines 134..140

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

            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 (reloadOnResize !== false && attrs.reloadOnResize !== undefined) {
                        scope.$watch('masonryContainer.offsetWidth', function (newWidth, oldWidth) {
                          if (newWidth != oldWidth) {
                            ctrl.reload();
                          }
            Severity: Major
            Found in angular-masonry.js and 1 other location - About 1 hr to fix
            src/angular-masonry.js on lines 163..169

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

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

                      pre: function preLink(scope, element, attrs, ctrl) {
                        var attrOptions = scope.$eval(attrs.masonry || attrs.masonryOptions);
                        var options = angular.extend({
                          itemSelector: attrs.itemSelector || '.masonry-brick',
                          columnWidth: parseInt(attrs.columnWidth, 10) || attrs.columnWidth
            Severity: Minor
            Found in src/angular-masonry.js - About 1 hr to fix

              Function exports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function (config) {
                'use strict';
              
                config.set({
                  basePath: '',
              Severity: Minor
              Found in karma.conf.js - About 1 hr to fix

                Function preLink has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        pre: function preLink(scope, element, attrs, ctrl) {
                          var attrOptions = scope.$eval(attrs.masonry || attrs.masonryOptions);
                          var options = angular.extend({
                              itemSelector: attrs.itemSelector || '.masonry-brick',
                              columnWidth: parseInt(attrs.columnWidth, 10) || attrs.columnWidth
                Severity: Minor
                Found in angular-masonry.js - About 1 hr to fix

                  Function addBrick has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        this.addBrick = function addBrick(method, element, id) {
                          if (destroyed) {
                            return;
                          }
                  
                  
                  Severity: Minor
                  Found in src/angular-masonry.js - About 1 hr to fix

                    Function addBrick has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          this.addBrick = function addBrick(method, element, id) {
                            if (destroyed) {
                              return;
                            }
                            function _add() {
                    Severity: Minor
                    Found in angular-masonry.js - About 1 hr to fix

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

                                  var options = angular.extend({
                                    itemSelector: attrs.itemSelector || '.masonry-brick',
                                    columnWidth: parseInt(attrs.columnWidth, 10) || attrs.columnWidth
                                  }, attrOptions || {});
                      Severity: Major
                      Found in src/angular-masonry.js and 1 other location - About 1 hr to fix
                      angular-masonry.js on lines 113..116

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

                      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

                                var options = angular.extend({
                                    itemSelector: attrs.itemSelector || '.masonry-brick',
                                    columnWidth: parseInt(attrs.columnWidth, 10) || attrs.columnWidth
                                  }, attrOptions || {});
                      Severity: Major
                      Found in angular-masonry.js and 1 other location - About 1 hr to fix
                      src/angular-masonry.js on lines 136..139

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

                      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