ryanmurakami/node-storenvy

View on GitHub

Showing 70 of 89 total issues

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

Client.prototype.updateFulfillment = function(orderId, fulfillmentId, attrs, callback, access_token) {
    var url = this.buildPushUrl(access_token, attrs).replace(this.endpointToken,
        this.endpoints.fulfillments
        .replace(this.idToken, orderId)
        .replace(this.idToken, fulfillmentId));
Severity: Major
Found in lib/client.js and 1 other location - About 3 hrs to fix
lib/client.js on lines 729..735

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

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

Client.prototype.updateVariant = function(productId, variantId, attrs, callback, access_token) {
    var url = this.buildPushUrl(access_token, attrs).replace(this.endpointToken,
        this.endpoints.variant
        .replace(this.idToken, productId)
        .replace(this.idToken, variantId));
Severity: Major
Found in lib/client.js and 1 other location - About 3 hrs to fix
lib/client.js on lines 555..561

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

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

        collectionTest: function() {
            se.public.getCollection('meatcube', 125448, function(err, data) {
                if(err) console.err(err);
                var obj = JSON.parse(data);
                if(obj.id === 125448)
Severity: Major
Found in examples/publicTests.js and 1 other location - About 3 hrs to fix
examples/publicTests.js on lines 45..54

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

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

        productTest: function() {
            se.public.getProduct('meatcube', 6509683, function(err, data) {
                if(err) console.err(err);
                var obj = JSON.parse(data);
                if(obj.id === 6509683)
Severity: Major
Found in examples/publicTests.js and 1 other location - About 3 hrs to fix
examples/publicTests.js on lines 78..87

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

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

Client.prototype.getVariant = function(productId, variantId, callback, access_token) {
    var url = this.getRootUrl(access_token).replace(this.endpointToken,
        this.endpoints.variant
        .replace(this.idToken, productId)
        .replace(this.idToken, variantId));
Severity: Major
Found in lib/client.js and 1 other location - About 3 hrs to fix
lib/client.js on lines 751..757

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

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

Client.prototype.deleteVariant = function(productId, variantId, callback, access_token) {
    var url = this.buildPushUrl(access_token).replace(this.endpointToken,
        this.endpoints.variant
        .replace(this.idToken, productId)
        .replace(this.idToken, variantId));
Severity: Major
Found in lib/client.js and 1 other location - About 3 hrs to fix
lib/client.js on lines 707..713

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

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

Client.prototype.createStore = function(name, subdomain, paypal_email, callback, access_token) {
    var attrs = {
        name: name,
        subdomain: subdomain,
        paypal_email: paypal_email
Severity: Major
Found in lib/client.js and 1 other location - About 3 hrs to fix
lib/client.js on lines 1008..1019

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

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

Client.prototype.createShippingClass = function(name, rates, countries, callback, 
    access_token) {
    
    var attrs = {
        name: name,
Severity: Major
Found in lib/client.js and 1 other location - About 3 hrs to fix
lib/client.js on lines 291..300

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

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

Client.prototype.createWebhook = function(webhookUrl, events, callback, access_token) {
    var attrs = {
        url: webhookUrl,
        events: events
    },
Severity: Major
Found in lib/client.js and 1 other location - About 2 hrs to fix
lib/client.js on lines 907..915

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

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

Client.prototype.createShippingGroup = function(name, rates, callback, access_token) {
    var attrs = {
        name: name,
        rates: rates
    },
Severity: Major
Found in lib/client.js and 1 other location - About 2 hrs to fix
lib/client.js on lines 1171..1179

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

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

Client.prototype.openOrder = function(id, callback, access_token) {
    var url = this.buildPushUrl(access_token).replace(this.endpointToken,
        this.endpoints.order.replace(this.idToken, id) + '/open');
    this.put(url, callback);
};
Severity: Major
Found in lib/client.js and 1 other location - About 2 hrs to fix
lib/client.js on lines 480..484

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

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

Client.prototype.holdOrder = function(id, callback, access_token) {
    var url = this.buildPushUrl(access_token).replace(this.endpointToken,
        this.endpoints.order.replace(this.idToken, id) + '/hold');
    this.put(url, callback);
};
Severity: Major
Found in lib/client.js and 1 other location - About 2 hrs to fix
lib/client.js on lines 499..503

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

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

Client.prototype.getOrderVariants = function(id, callback, access_token) {
    var url = this.getRootUrl(access_token).replace(this.endpointToken, 
        this.endpoints.order_variants.replace(this.idToken, id));
    this.get(url, callback);
};
Severity: Major
Found in lib/client.js and 12 other locations - About 2 hrs to fix
lib/client.js on lines 442..446
lib/client.js on lines 517..521
lib/client.js on lines 593..597
lib/client.js on lines 660..664
lib/client.js on lines 788..792
lib/client.js on lines 852..857
lib/client.js on lines 888..892
lib/client.js on lines 953..957
lib/client.js on lines 988..992
lib/client.js on lines 1061..1065
lib/client.js on lines 1152..1156
lib/client.js on lines 1217..1221

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

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

Client.prototype.getCollection = function(id, callback, access_token) {
    var url = this.getRootUrl(access_token).replace(this.endpointToken, 
        this.endpoints.collection.replace(this.idToken, id));
    this.get(url, callback);
};
Severity: Major
Found in lib/client.js and 12 other locations - About 2 hrs to fix
lib/client.js on lines 442..446
lib/client.js on lines 517..521
lib/client.js on lines 535..539
lib/client.js on lines 593..597
lib/client.js on lines 660..664
lib/client.js on lines 852..857
lib/client.js on lines 888..892
lib/client.js on lines 953..957
lib/client.js on lines 988..992
lib/client.js on lines 1061..1065
lib/client.js on lines 1152..1156
lib/client.js on lines 1217..1221

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

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

Public.prototype.getCollections = function(storeSubdomain, callback, page, perPage) {
    var path = 'collections.json?' + 
        (page ? 'page=' + page + '&' : '') +
        (perPage ? 'per_page=' + perPage : '');
    this.retrieve(this.urlBuilder(storeSubdomain, path), callback);
Severity: Major
Found in lib/public.js and 1 other location - About 2 hrs to fix
lib/public.js on lines 61..66

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

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

Client.prototype.getShippingClass = function(id, callback, access_token) {
    var url = this.getRootUrl(access_token).replace(this.endpointToken, 
        this.endpoints.shipping_class.replace(this.idToken, id));
    this.get(url, callback);
};
Severity: Major
Found in lib/client.js and 12 other locations - About 2 hrs to fix
lib/client.js on lines 442..446
lib/client.js on lines 517..521
lib/client.js on lines 535..539
lib/client.js on lines 593..597
lib/client.js on lines 660..664
lib/client.js on lines 788..792
lib/client.js on lines 852..857
lib/client.js on lines 888..892
lib/client.js on lines 953..957
lib/client.js on lines 1061..1065
lib/client.js on lines 1152..1156
lib/client.js on lines 1217..1221

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

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

Client.prototype.deleteCollection = function(id, callback, access_token) {
    var url = this.buildPushUrl(access_token).replace(this.endpointToken,
        this.endpoints.collection
        .replace(this.idToken, id));
    this.delete(url, callback);
Severity: Major
Found in lib/client.js and 12 other locations - About 2 hrs to fix
lib/client.js on lines 442..446
lib/client.js on lines 517..521
lib/client.js on lines 535..539
lib/client.js on lines 593..597
lib/client.js on lines 660..664
lib/client.js on lines 788..792
lib/client.js on lines 888..892
lib/client.js on lines 953..957
lib/client.js on lines 988..992
lib/client.js on lines 1061..1065
lib/client.js on lines 1152..1156
lib/client.js on lines 1217..1221

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

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

Client.prototype.getProduct = function(id, callback, access_token) {
    var url = this.getRootUrl(access_token).replace(this.endpointToken, 
        this.endpoints.product.replace(this.idToken, id));
    this.get(url, callback);
};
Severity: Major
Found in lib/client.js and 12 other locations - About 2 hrs to fix
lib/client.js on lines 442..446
lib/client.js on lines 517..521
lib/client.js on lines 535..539
lib/client.js on lines 660..664
lib/client.js on lines 788..792
lib/client.js on lines 852..857
lib/client.js on lines 888..892
lib/client.js on lines 953..957
lib/client.js on lines 988..992
lib/client.js on lines 1061..1065
lib/client.js on lines 1152..1156
lib/client.js on lines 1217..1221

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

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

Client.prototype.deleteShippingClass = function(id, callback, access_token) {
    var url = this.buildPushUrl(access_token).replace(this.endpointToken,
        this.endpoints.shipping_class.replace(this.idToken, id));
    this.delete(url, callback);
};
Severity: Major
Found in lib/client.js and 12 other locations - About 2 hrs to fix
lib/client.js on lines 442..446
lib/client.js on lines 517..521
lib/client.js on lines 535..539
lib/client.js on lines 593..597
lib/client.js on lines 660..664
lib/client.js on lines 788..792
lib/client.js on lines 852..857
lib/client.js on lines 888..892
lib/client.js on lines 953..957
lib/client.js on lines 988..992
lib/client.js on lines 1152..1156
lib/client.js on lines 1217..1221

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

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

Public.prototype.getProducts = function(storeSubdomain, callback, page, perPage) {
    var path = 'products.json?' + 
        (page ? 'page=' + page + '&' : '') +
        (perPage ? 'per_page=' + perPage : '');
    this.retrieve(this.urlBuilder(storeSubdomain, path), callback);
Severity: Major
Found in lib/public.js and 1 other location - About 2 hrs to fix
lib/public.js on lines 88..93

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

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