XingFramework/xing-frontend-utils

View on GitHub

Showing 208 of 208 total issues

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

},{}],16:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
Severity: Major
Found in dist/xing-frontend-utils.js and 5 other locations - About 1 hr to fix
dist/xing-frontend-utils.js on lines 2648..2658
dist/xing-frontend-utils.js on lines 2763..2773
dist/xing-frontend-utils.js on lines 2872..2882
dist/xing-frontend-utils.js on lines 3146..3156
dist/xing-frontend-utils.js on lines 3348..3358

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

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

},{"./compiler.js":14}],18:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
Severity: Major
Found in dist/xing-frontend-utils.js and 5 other locations - About 1 hr to fix
dist/xing-frontend-utils.js on lines 2648..2658
dist/xing-frontend-utils.js on lines 2763..2773
dist/xing-frontend-utils.js on lines 2872..2882
dist/xing-frontend-utils.js on lines 3146..3156
dist/xing-frontend-utils.js on lines 3156..3166

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

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

    return function SwipeService(scope, eventTypes) {
      if (!eventTypes) {
        eventTypes = "swipeleft swiperight";
      }

Severity: Minor
Found in dist/xing-frontend-utils.js - About 1 hr to fix

    Function BindBuilder has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var BindBuilder = (function () {
          function BindBuilder(bindParam, component) {
            _classCallCheck(this, BindBuilder);
    
            this._bindParam = bindParam;
    Severity: Minor
    Found in dist/xing-frontend-utils.js - About 1 hr to fix

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

          function hide(success) {
            var interimElement = stack.shift();
            interimElement.remove().then(function () {
              interimElement.deferred.resolve(success);
            });
      Severity: Major
      Found in dist/xing-frontend-utils.js and 3 other locations - About 1 hr to fix
      dist/xing-frontend-utils.js on lines 3292..3297
      src/xing-frontend-utils/components/toast/interimElement.js on lines 115..120
      src/xing-frontend-utils/components/toast/interimElement.js on lines 135..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 65.

      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

          function hide(success) {
            var interimElement = stack.shift();
            interimElement.remove().then(function() {
              interimElement.deferred.resolve(success);
            });
      Severity: Major
      Found in src/xing-frontend-utils/components/toast/interimElement.js and 3 other locations - About 1 hr to fix
      dist/xing-frontend-utils.js on lines 3272..3277
      dist/xing-frontend-utils.js on lines 3292..3297
      src/xing-frontend-utils/components/toast/interimElement.js on lines 135..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 65.

      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

          function cancel(reason) {
            var interimElement = stack.shift();
            interimElement.remove().then(function () {
              interimElement.deferred.reject(reason);
            });
      Severity: Major
      Found in dist/xing-frontend-utils.js and 3 other locations - About 1 hr to fix
      dist/xing-frontend-utils.js on lines 3272..3277
      src/xing-frontend-utils/components/toast/interimElement.js on lines 115..120
      src/xing-frontend-utils/components/toast/interimElement.js on lines 135..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 65.

      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

          function cancel(reason) {
            var interimElement = stack.shift();
            interimElement.remove().then(function() {
              interimElement.deferred.reject(reason);
            });
      Severity: Major
      Found in src/xing-frontend-utils/components/toast/interimElement.js and 3 other locations - About 1 hr to fix
      dist/xing-frontend-utils.js on lines 3272..3277
      dist/xing-frontend-utils.js on lines 3292..3297
      src/xing-frontend-utils/components/toast/interimElement.js on lines 115..120

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

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

      },{"./error-list.tpl.js":15,"./error.tpl.js":16,"./interimElement.js":17,"./notice.tpl.js":18,"./swipe.js":19,"a1atscript":1,"xing-inflector":2}],21:[function(require,module,exports){
      'use strict';
      
      Object.defineProperty(exports, '__esModule', {
        value: true
      Severity: Minor
      Found in dist/xing-frontend-utils.js - About 1 hr to fix

        Function InterimElement has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function InterimElement(options) {
              var self;
              var hideTimeout, element;
        
              options = options || {};
        Severity: Minor
        Found in src/xing-frontend-utils/components/toast/interimElement.js - About 1 hr to fix

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

              $rootScope.$on('$stateChangeStart', (event, toState, toParams, fromState, fromParams) => {
                /*jshint -W075 */
                console.log("Routing Event", event.name);
                console.log("From State", fromState.name, fromState.url);
                console.log("To State", toState.name, toState.url);
          Severity: Major
          Found in src/xing-frontend-utils/ui-route-logger.js and 1 other location - About 1 hr to fix
          dist/xing-frontend-utils.js on lines 4781..4786

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

          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

                    Object.defineProperty(this._component.prototype, BIND_PREFIX + key, {
                      enumerable: true,
                      configurable: true,
                      set: genericSetter(BINDING, RAW_STRING),
                      get: function get() {
          Severity: Major
          Found in dist/xing-frontend-utils.js and 1 other location - About 1 hr to fix
          dist/xing-frontend-utils.js on lines 2107..2114

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

          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

                    Object.defineProperty(this._component.prototype, STRING_PREFIX + key, {
                      enumerable: true,
                      configurable: true,
                      set: genericSetter(RAW_STRING, BINDING),
                      get: function get() {
          Severity: Major
          Found in dist/xing-frontend-utils.js and 1 other location - About 1 hr to fix
          dist/xing-frontend-utils.js on lines 2097..2104

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

          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

              $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
                /*jshint -W075 */
                console.log("Routing Event", event.name);
                console.log("From State", fromState.name, fromState.url);
                console.log("To State", toState.name, toState.url);
          Severity: Major
          Found in dist/xing-frontend-utils.js and 1 other location - About 1 hr to fix
          src/xing-frontend-utils/ui-route-logger.js on lines 5..10

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

          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

          gulp.task('bump:major', function(){
            gulp.src(['./bower.json', './package.json'])
            .pipe(bump({type:'major'}))
            .pipe(gulp.dest('./'));
          });
          Severity: Major
          Found in gulpfile.js and 1 other location - About 1 hr to fix
          gulpfile.js on lines 103..107

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

          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

          gulp.task('bump:minor', function(){
            gulp.src(['./bower.json', './package.json'])
            .pipe(bump({type:'minor'}))
            .pipe(gulp.dest('./'));
          });
          Severity: Major
          Found in gulpfile.js and 1 other location - About 1 hr to fix
          gulpfile.js on lines 111..115

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

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

              function InterimElement(options) {
                var self;
                var hideTimeout, element;
          
                options = options || {};
          Severity: Minor
          Found in dist/xing-frontend-utils.js - About 1 hr to fix

            Function SwipeService has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  return function SwipeService(scope, eventTypes) {
                    if ( !eventTypes ) { eventTypes = "swipeleft swiperight"; }
            
                    // publish configureFor() method for specific element instance
                    return function configureFor(element, onSwipeCallback, attachLater ) {
            Severity: Minor
            Found in src/xing-frontend-utils/components/toast/swipe.js - About 1 hr to fix

              Function xngToastService has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              function xngToastService($timeout, $$interimElement, $animate, $xngSwipe, Inflector) {
              
                var factoryDef = {
                  onShow: onShow,
                  onRemove: onRemove,
              Severity: Minor
              Found in src/xing-frontend-utils/components/toast/toast.js - About 1 hr 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 configureFor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    return function configureFor(element, onSwipeCallback, attachLater) {
                      var hammertime = new Hammer(element[0], {
                        recognizers: addRecognizers([], eventTypes)
                      });
              
              
              Severity: Minor
              Found in dist/xing-frontend-utils.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language