jakubrohleder/angular-jsonapi

View on GitHub

Showing 126 of 126 total issues

Function AngularJsonAPIAbstractModelWrapper has 488 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function AngularJsonAPIAbstractModelWrapper(
    AngularJsonAPIModelSourceError,
    AngularJsonAPIModelValidationError,
    AngularJsonAPIModelErrorsManager,
    AngularJsonAPIModelLinkerService,
Severity: Major
Found in src/model/abstract-model/abstract-model.js - About 2 days to fix

    Function AngularJsonAPIModelLinkerService has 271 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function AngularJsonAPIModelLinkerService($log) {
        var _this = this;
    
        _this.toLinkData = toLinkData;
    
    
    Severity: Major
    Found in src/model/model-linker/model-linker.js - About 1 day to fix

      File abstract-model.js has 525 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      (function() {
        'use strict';
      
        angular.module('angular-jsonapi')
        .factory('AngularJsonAPIAbstractModel', AngularJsonAPIAbstractModelWrapper);
      Severity: Major
      Found in src/model/abstract-model/abstract-model.js - About 1 day to fix

        Function AngularJsonAPISourceRestWrapper has 182 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function AngularJsonAPISourceRestWrapper(
            AngularJsonAPIModelSourceError,
            AngularJsonAPISourcePrototype,
            AngularJsonAPIModelLinkerService,
            toKebabCase,
        Severity: Major
        Found in src/sources/rest/source-rest.factory.js - About 7 hrs to fix

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

                if (target === undefined) {
                  error = AngularJsonAPIModelSourceError.create('Can\'t link undefined', null, 0, 'link');
                  _this.errors.synchronization.add('link', error);
                  deferred.reject(error);
                } else if (_this.new === true) {
          Severity: Major
          Found in src/model/abstract-model/abstract-model.js and 1 other location - About 6 hrs to fix
          src/model/abstract-model/abstract-model.js on lines 516..530

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

          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 (target === undefined) {
                  error = AngularJsonAPIModelSourceError.create('Can\'t unlink undefined', null, 0, 'unlink');
                  _this.errors.synchronization.add('unlink', error);
                  deferred.reject(_this);
                } else if (_this.new === true) {
          Severity: Major
          Found in src/model/abstract-model/abstract-model.js and 1 other location - About 6 hrs to fix
          src/model/abstract-model/abstract-model.js on lines 429..443

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

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

            function AngularJsonAPIResourceCacheWrapper(
              uuid4,
              $log
            ) {
          
          
          Severity: Major
          Found in src/resource/resource-cache/resource-cache.factory.js - About 5 hrs to fix

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

                  if (target !== undefined && target !== null && reflectionKey !== false) {
                    reflectionSchema = target.schema.relationships[reflectionKey];
                    if (reflectionSchema !== undefined) {
                      if (reflectionSchema.type === 'hasOne') {
                        __addHasOne(target, reflectionKey, object, form);
            Severity: Major
            Found in src/model/model-linker/model-linker.js and 1 other location - About 5 hrs to fix
            src/model/model-linker/model-linker.js on lines 178..193

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

            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 (oldReflection !== undefined && oldReflection !== null) {
                    oldReflectionSchema = oldReflection.schema.relationships[reflectionKey];
            
                    if (oldReflectionSchema !== undefined) {
                      if (oldReflectionSchema.type === 'hasOne') {
            Severity: Major
            Found in src/model/model-linker/model-linker.js and 1 other location - About 5 hrs to fix
            src/model/model-linker/model-linker.js on lines 195..209

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

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

                function AngularJsonAPISourceRest(name, url) {
                  var _this = this;
                  var headers = { // jscs:disable disallowQuotedKeysInObjects
                    'Accept': 'application/vnd.api+json',
                    'Content-Type': 'application/vnd.api+json'
            Severity: Major
            Found in src/sources/rest/source-rest.factory.js - About 5 hrs to fix

              Function AngularJsonAPICollectionWrapper has 126 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function AngularJsonAPICollectionWrapper(
                  AngularJsonAPIModelSourceError,
                  AngularJsonAPIModelErrorsManager,
                  $rootScope,
                  $injector,
              Severity: Major
              Found in src/collection/collection.factory.js - About 5 hrs to fix

                Function AngularJsonAPIResourceWrapper has 122 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function AngularJsonAPIResourceWrapper(
                    AngularJsonAPIModel,
                    AngularJsonAPISchema,
                    AngularJsonAPIResourceCache,
                    AngularJsonAPICollection,
                Severity: Major
                Found in src/resource/resource.factory.js - About 4 hrs to fix

                  Function AngularJsonAPIModelFormWrapper has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function AngularJsonAPIModelFormWrapper(
                      AngularJsonAPIModelValidationError,
                      AngularJsonAPIModelLinkerService,
                      validateJS,
                      $q
                  Severity: Major
                  Found in src/model/model-form/model-form.factory.js - About 4 hrs to fix

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

                            function resolveIncluded(includedResponse) {
                              angular.forEach(includedResponse, function(operation, key) {
                                if (operation.success === true) {
                                  $rootScope.$emit('angularJsonAPI:' + results.included[key].data.type + ':object:include', 'resolved', results.included[key], operation);
                                  operation.value.finish();
                    Severity: Major
                    Found in src/model/abstract-model/abstract-model.js and 1 other location - About 4 hrs to fix
                    src/collection/collection.factory.js on lines 170..180

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

                    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 resolveIncluded(includedResponse) {
                              angular.forEach(includedResponse, function(operation, key) {
                                if (operation.success === true) {
                                  $rootScope.$emit('angularJsonAPI:' + results.included[key].data.type + ':object:include', 'resolved', results.included[key], operation);
                    
                    
                    Severity: Major
                    Found in src/collection/collection.factory.js and 1 other location - About 4 hrs to fix
                    src/model/abstract-model/abstract-model.js on lines 229..238

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

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

                      function AngularJsonAPISourceParseWrapper(
                        AngularJsonAPIModelSourceError,
                        AngularJsonAPISourcePrototype,
                        AngularJsonAPIModelLinkerService,
                        pluralize,
                    Severity: Major
                    Found in src/sources/parse/source-parse.factory.js - About 3 hrs to fix

                      Function AngularJsonAPISynchronizerSimpleWrapper has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function AngularJsonAPISynchronizerSimpleWrapper(AngularJsonAPISynchronizerPrototype, $q, $log) {
                      
                          AngularJsonAPISynchronizerSimple.prototype = Object.create(AngularJsonAPISynchronizerPrototype.prototype);
                          AngularJsonAPISynchronizerSimple.prototype.constructor = AngularJsonAPISynchronizerSimple;
                      
                      
                      Severity: Major
                      Found in src/synchronizers/synchronizer-simple.factory.js - About 3 hrs to fix

                        Function AngularJsonAPISourceParse has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function AngularJsonAPISourceParse(name, table) {
                              var _this = this;
                        
                              _this.ParseObject = Parse.Object.extend(table);
                              _this.type = pluralize(table).charAt(0).toLowerCase() + pluralize(table).slice(1);
                        Severity: Major
                        Found in src/sources/parse/source-parse.factory.js - About 3 hrs to fix

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

                                function reject(response) {
                                  $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:link', 'rejected', _this, response);
                          
                                  deferred.reject(response.errors);
                                  response.finish();
                          Severity: Major
                          Found in src/model/abstract-model/abstract-model.js and 1 other location - About 3 hrs to fix
                          src/model/abstract-model/abstract-model.js on lines 570..577

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

                          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

                                function reject(response) {
                                  $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:unlink', 'rejected', _this, response);
                          
                                  deferred.reject(response.errors);
                                  response.finish();
                          Severity: Major
                          Found in src/model/abstract-model/abstract-model.js and 1 other location - About 3 hrs to fix
                          src/model/abstract-model/abstract-model.js on lines 483..490

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

                          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