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,
Function AngularJsonAPIModelLinkerService
has 271 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AngularJsonAPIModelLinkerService($log) {
var _this = this;
_this.toLinkData = toLinkData;
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);
Function AngularJsonAPISourceRestWrapper
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AngularJsonAPISourceRestWrapper(
AngularJsonAPIModelSourceError,
AngularJsonAPISourcePrototype,
AngularJsonAPIModelLinkerService,
toKebabCase,
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) {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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) {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function AngularJsonAPIResourceCacheWrapper
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AngularJsonAPIResourceCacheWrapper(
uuid4,
$log
) {
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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') {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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'
Function AngularJsonAPICollectionWrapper
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AngularJsonAPICollectionWrapper(
AngularJsonAPIModelSourceError,
AngularJsonAPIModelErrorsManager,
$rootScope,
$injector,
Function AngularJsonAPIResourceWrapper
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AngularJsonAPIResourceWrapper(
AngularJsonAPIModel,
AngularJsonAPISchema,
AngularJsonAPIResourceCache,
AngularJsonAPICollection,
Function AngularJsonAPIModelFormWrapper
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AngularJsonAPIModelFormWrapper(
AngularJsonAPIModelValidationError,
AngularJsonAPIModelLinkerService,
validateJS,
$q
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();
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function AngularJsonAPISourceParseWrapper
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AngularJsonAPISourceParseWrapper(
AngularJsonAPIModelSourceError,
AngularJsonAPISourcePrototype,
AngularJsonAPIModelLinkerService,
pluralize,
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;
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);
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();
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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();
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76