XingFramework/xing-frontend-utils

View on GitHub

Showing 208 of 208 total issues

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

        dependencyList.forEach(function (dependencyObject) {
          var metadata = dependencyObject.metadata;
          var StateClass = dependencyObject.dependency;
          var state = new StateClass();
          injector.annotateResolves(state);
Severity: Major
Found in dist/xing-frontend-utils.js and 1 other location - About 1 hr to fix
src/xing-frontend-utils/stateInjector.js on lines 51..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 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

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

      dependencyList.forEach((dependencyObject) => {
        var metadata = dependencyObject.metadata;
        var StateClass = dependencyObject.dependency;
        var state = new StateClass();
        injector.annotateResolves(state);
Severity: Major
Found in src/xing-frontend-utils/stateInjector.js and 1 other location - About 1 hr to fix
dist/xing-frontend-utils.js on lines 4746..4752

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

        value: function setupProperty(key, properties) {
          properties[STRING_PREFIX + key] = "@" + this.bindObj[key];
          properties[BIND_PREFIX + key] = "=?bind" + this.bindObj[key][0].toUpperCase() + this.bindObj[key].slice(1);

          // This property is used when user uses the `bind-property` attribute on a directive to bind an expression
Severity: Minor
Found in dist/xing-frontend-utils.js - About 1 hr to fix

    Function configureFor has 33 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 src/xing-frontend-utils/components/toast/swipe.js - About 1 hr to fix

      Function StateAttrs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var StateAttrs = (function () {
        function StateAttrs($compile, $state) {
          _classCallCheck(this, _StateAttrs);
      
          this.$compile = $compile;
      Severity: Minor
      Found in dist/xing-frontend-utils.js - About 1 hr to fix

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

        },{"../../stateInjector.js":26,"./error-fallback.tpl.js":8,"a1atscript":1}],10:[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 AnnotationFinder has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

                $rootScope.$on('$stateChangeSuccess', function (event, toState) {
                  console.group();
                  console.table({ event: event });
                  console.table({ toState: toState });
                  console.groupEnd();
            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 47..52

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

            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

                $rootScope.$on('$stateChangeSuccess', (event, toState) => {
                  console.group();
                  console.table({event});
                  console.table({toState});
                  console.groupEnd();
            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 4823..4828

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

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

            },{}],9:[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 whenGoto has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function whenGoto($location) {
                var search = $location.search();
                if (search.goto) {
                  var target = search.goto;
              
              
              Severity: Minor
              Found in src/xing-frontend-utils/whenGoto.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 whenGoto has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              export function whenGoto($location) {
                var search = $location.search();
                if (search.goto) {
                  var target = search.goto;
              
              
              Severity: Minor
              Found in src/xing-frontend-utils/appConfig.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 ComponentMapping has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function 7 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{"a1atscript":1}],7:[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

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

                    function onRemove(scope, element, options) {
                      options.detachSwipe();
                      options.parent.removeClass(toastOpenClass(options.position));
                      return $animate.leave(element);
                    }
                  Severity: Major
                  Found in dist/xing-frontend-utils.js and 1 other location - About 1 hr to fix
                  src/xing-frontend-utils/components/toast/toast.js on lines 214..218

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

                  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

                    function onRemove(scope, element, options) {
                      options.detachSwipe();
                      options.parent.removeClass(toastOpenClass(options.position));
                      return $animate.leave(element);
                    }
                  Severity: Major
                  Found in src/xing-frontend-utils/components/toast/toast.js and 1 other location - About 1 hr to fix
                  dist/xing-frontend-utils.js on lines 3836..3840

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

                  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 InterimElementFactory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function InterimElementFactory($q, $rootScope, $timeout, $rootElement, $animate, $xngCompiler) {
                  Severity: Minor
                  Found in src/xing-frontend-utils/components/toast/interimElement.js - About 45 mins to fix

                    Function xngCompilerService has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function xngCompilerService($q, $http, $injector, $compile, $controller, $templateCache) {
                    Severity: Minor
                    Found in src/xing-frontend-utils/components/toast/compiler.js - About 45 mins to fix

                      Function xngCompilerService has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function xngCompilerService($q, $http, $injector, $compile, $controller, $templateCache) {
                      Severity: Minor
                      Found in dist/xing-frontend-utils.js - About 45 mins to fix

                        Function InterimElementFactory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function InterimElementFactory($q, $rootScope, $timeout, $rootElement, $animate, $xngCompiler) {
                        Severity: Minor
                        Found in dist/xing-frontend-utils.js - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language