28msec/28.io-nodejs

View on GitHub
lib/account.api.28.io.js

Summary

Maintainability
F
2 mos
Test Coverage

Function Account has 1239 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Account = (function() {
    'use strict';

    var request = require('request');
    var Q = require('q');
Severity: Major
Found in lib/account.api.28.io.js - About 6 days to fix

    Function Account has a Cognitive Complexity of 288 (exceeds 5 allowed). Consider refactoring.
    Open

    var Account = (function() {
        'use strict';
    
        var request = require('request');
        var Q = require('q');
    Severity: Minor
    Found in lib/account.api.28.io.js - About 5 days 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

    File account.api.28.io.js has 1243 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*jshint -W069 */
    /**
     * 
     * @class Account
     * @param {(string|object)} [domainOrOptions] - The project domain or options object. If object, see the object's optional properties.
    Severity: Major
    Found in lib/account.api.28.io.js - About 3 days to fix

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

          Account.prototype.createAccount = function(parameters) {
              if (parameters === undefined) {
                  parameters = {};
              }
              var deferred = Q.defer();
      Severity: Major
      Found in lib/account.api.28.io.js - About 3 hrs to fix

        Function createSubscription has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Account.prototype.createSubscription = function(parameters) {
                if (parameters === undefined) {
                    parameters = {};
                }
                var deferred = Q.defer();
        Severity: Major
        Found in lib/account.api.28.io.js - About 3 hrs to fix

          Function updateAccount has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Account.prototype.updateAccount = function(parameters) {
                  if (parameters === undefined) {
                      parameters = {};
                  }
                  var deferred = Q.defer();
          Severity: Major
          Found in lib/account.api.28.io.js - About 3 hrs to fix

            Function updateSubscription has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Account.prototype.updateSubscription = function(parameters) {
                    if (parameters === undefined) {
                        parameters = {};
                    }
                    var deferred = Q.defer();
            Severity: Major
            Found in lib/account.api.28.io.js - About 3 hrs to fix

              Function resetPassword has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Account.prototype.resetPassword = function(parameters) {
                      if (parameters === undefined) {
                          parameters = {};
                      }
                      var deferred = Q.defer();
              Severity: Major
              Found in lib/account.api.28.io.js - About 2 hrs to fix

                Function listInvoices has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Account.prototype.listInvoices = function(parameters) {
                        if (parameters === undefined) {
                            parameters = {};
                        }
                        var deferred = Q.defer();
                Severity: Major
                Found in lib/account.api.28.io.js - About 2 hrs to fix

                  Function terminateSubscription has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Account.prototype.terminateSubscription = function(parameters) {
                          if (parameters === undefined) {
                              parameters = {};
                          }
                          var deferred = Q.defer();
                  Severity: Major
                  Found in lib/account.api.28.io.js - About 2 hrs to fix

                    Function getSubscription has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        Account.prototype.getSubscription = function(parameters) {
                            if (parameters === undefined) {
                                parameters = {};
                            }
                            var deferred = Q.defer();
                    Severity: Major
                    Found in lib/account.api.28.io.js - About 2 hrs to fix

                      Function getInvoice has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          Account.prototype.getInvoice = function(parameters) {
                              if (parameters === undefined) {
                                  parameters = {};
                              }
                              var deferred = Q.defer();
                      Severity: Major
                      Found in lib/account.api.28.io.js - About 2 hrs to fix

                        Function getAccountMetadata has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            Account.prototype.getAccountMetadata = function(parameters) {
                                if (parameters === undefined) {
                                    parameters = {};
                                }
                                var deferred = Q.defer();
                        Severity: Major
                        Found in lib/account.api.28.io.js - About 2 hrs to fix

                          Function listSubscriptions has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              Account.prototype.listSubscriptions = function(parameters) {
                                  if (parameters === undefined) {
                                      parameters = {};
                                  }
                                  var deferred = Q.defer();
                          Severity: Major
                          Found in lib/account.api.28.io.js - About 2 hrs to fix

                            Function checkResetToken has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                Account.prototype.checkResetToken = function(parameters) {
                                    if (parameters === undefined) {
                                        parameters = {};
                                    }
                                    var deferred = Q.defer();
                            Severity: Major
                            Found in lib/account.api.28.io.js - About 2 hrs to fix

                              Function confirmAccount has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  Account.prototype.confirmAccount = function(parameters) {
                                      if (parameters === undefined) {
                                          parameters = {};
                                      }
                                      var deferred = Q.defer();
                              Severity: Major
                              Found in lib/account.api.28.io.js - About 2 hrs to fix

                                Function sendResetToken has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    Account.prototype.sendResetToken = function(parameters) {
                                        if (parameters === undefined) {
                                            parameters = {};
                                        }
                                        var deferred = Q.defer();
                                Severity: Major
                                Found in lib/account.api.28.io.js - About 2 hrs to fix

                                  Function getBillingData has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      Account.prototype.getBillingData = function(parameters) {
                                          if (parameters === undefined) {
                                              parameters = {};
                                          }
                                          var deferred = Q.defer();
                                  Severity: Major
                                  Found in lib/account.api.28.io.js - About 2 hrs to fix

                                    Function checkAccount has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        Account.prototype.checkAccount = function(parameters) {
                                            if (parameters === undefined) {
                                                parameters = {};
                                            }
                                            var deferred = Q.defer();
                                    Severity: Major
                                    Found in lib/account.api.28.io.js - About 2 hrs to fix

                                      Function resendConfirmation has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          Account.prototype.resendConfirmation = function(parameters) {
                                              if (parameters === undefined) {
                                                  parameters = {};
                                              }
                                              var deferred = Q.defer();
                                      Severity: Major
                                      Found in lib/account.api.28.io.js - About 2 hrs to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                return deferred.promise;
                                        Severity: Major
                                        Found in lib/account.api.28.io.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return deferred.promise;
                                          Severity: Major
                                          Found in lib/account.api.28.io.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return deferred.promise;
                                            Severity: Major
                                            Found in lib/account.api.28.io.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                          return deferred.promise;
                                              Severity: Major
                                              Found in lib/account.api.28.io.js - About 30 mins to fix

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

                                                    Account.prototype.updateSubscription = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 1 other location - About 4 days to fix
                                                lib/datasources.api.28.io.js on lines 699..792

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

                                                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

                                                    Account.prototype.resetPassword = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 1 other location - About 3 days to fix
                                                lib/project.api.28.io.js on lines 1147..1233

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

                                                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

                                                    Account.prototype.listInvoices = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 1 other location - About 3 days to fix
                                                lib/project.api.28.io.js on lines 552..637

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

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

                                                    Account.prototype.getSubscription = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 4 other locations - About 3 days to fix
                                                lib/datasources.api.28.io.js on lines 307..391
                                                lib/datasources.api.28.io.js on lines 510..594
                                                lib/datasources.api.28.io.js on lines 604..688
                                                lib/project.api.28.io.js on lines 1243..1327

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

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

                                                    Account.prototype.sendResetToken = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 17 other locations - About 3 days to fix
                                                lib/account.api.28.io.js on lines 225..302
                                                lib/account.api.28.io.js on lines 493..570
                                                lib/account.api.28.io.js on lines 579..656
                                                lib/account.api.28.io.js on lines 847..924
                                                lib/account.api.28.io.js on lines 1120..1197
                                                lib/datasources.api.28.io.js on lines 109..186
                                                lib/modules.api.28.io.js on lines 129..206
                                                lib/project.api.28.io.js on lines 378..455
                                                lib/project.api.28.io.js on lines 464..541
                                                lib/project.api.28.io.js on lines 646..723
                                                lib/project.api.28.io.js on lines 732..809
                                                lib/project.api.28.io.js on lines 1060..1137
                                                lib/project.api.28.io.js on lines 1336..1413
                                                lib/queries.api.28.io.js on lines 31..108
                                                lib/queries.api.28.io.js on lines 315..392
                                                lib/queries.api.28.io.js on lines 604..681
                                                lib/queries.api.28.io.js on lines 690..767

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

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

                                                    Account.prototype.listSubscriptions = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 17 other locations - About 3 days to fix
                                                lib/account.api.28.io.js on lines 225..302
                                                lib/account.api.28.io.js on lines 493..570
                                                lib/account.api.28.io.js on lines 579..656
                                                lib/account.api.28.io.js on lines 761..838
                                                lib/account.api.28.io.js on lines 847..924
                                                lib/datasources.api.28.io.js on lines 109..186
                                                lib/modules.api.28.io.js on lines 129..206
                                                lib/project.api.28.io.js on lines 378..455
                                                lib/project.api.28.io.js on lines 464..541
                                                lib/project.api.28.io.js on lines 646..723
                                                lib/project.api.28.io.js on lines 732..809
                                                lib/project.api.28.io.js on lines 1060..1137
                                                lib/project.api.28.io.js on lines 1336..1413
                                                lib/queries.api.28.io.js on lines 31..108
                                                lib/queries.api.28.io.js on lines 315..392
                                                lib/queries.api.28.io.js on lines 604..681
                                                lib/queries.api.28.io.js on lines 690..767

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

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

                                                    Account.prototype.getBillingData = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 17 other locations - About 3 days to fix
                                                lib/account.api.28.io.js on lines 225..302
                                                lib/account.api.28.io.js on lines 493..570
                                                lib/account.api.28.io.js on lines 579..656
                                                lib/account.api.28.io.js on lines 761..838
                                                lib/account.api.28.io.js on lines 1120..1197
                                                lib/datasources.api.28.io.js on lines 109..186
                                                lib/modules.api.28.io.js on lines 129..206
                                                lib/project.api.28.io.js on lines 378..455
                                                lib/project.api.28.io.js on lines 464..541
                                                lib/project.api.28.io.js on lines 646..723
                                                lib/project.api.28.io.js on lines 732..809
                                                lib/project.api.28.io.js on lines 1060..1137
                                                lib/project.api.28.io.js on lines 1336..1413
                                                lib/queries.api.28.io.js on lines 31..108
                                                lib/queries.api.28.io.js on lines 315..392
                                                lib/queries.api.28.io.js on lines 604..681
                                                lib/queries.api.28.io.js on lines 690..767

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

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

                                                    Account.prototype.confirmAccount = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 17 other locations - About 3 days to fix
                                                lib/account.api.28.io.js on lines 225..302
                                                lib/account.api.28.io.js on lines 579..656
                                                lib/account.api.28.io.js on lines 761..838
                                                lib/account.api.28.io.js on lines 847..924
                                                lib/account.api.28.io.js on lines 1120..1197
                                                lib/datasources.api.28.io.js on lines 109..186
                                                lib/modules.api.28.io.js on lines 129..206
                                                lib/project.api.28.io.js on lines 378..455
                                                lib/project.api.28.io.js on lines 464..541
                                                lib/project.api.28.io.js on lines 646..723
                                                lib/project.api.28.io.js on lines 732..809
                                                lib/project.api.28.io.js on lines 1060..1137
                                                lib/project.api.28.io.js on lines 1336..1413
                                                lib/queries.api.28.io.js on lines 31..108
                                                lib/queries.api.28.io.js on lines 315..392
                                                lib/queries.api.28.io.js on lines 604..681
                                                lib/queries.api.28.io.js on lines 690..767

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

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

                                                    Account.prototype.getAccountMetadata = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 17 other locations - About 3 days to fix
                                                lib/account.api.28.io.js on lines 493..570
                                                lib/account.api.28.io.js on lines 579..656
                                                lib/account.api.28.io.js on lines 761..838
                                                lib/account.api.28.io.js on lines 847..924
                                                lib/account.api.28.io.js on lines 1120..1197
                                                lib/datasources.api.28.io.js on lines 109..186
                                                lib/modules.api.28.io.js on lines 129..206
                                                lib/project.api.28.io.js on lines 378..455
                                                lib/project.api.28.io.js on lines 464..541
                                                lib/project.api.28.io.js on lines 646..723
                                                lib/project.api.28.io.js on lines 732..809
                                                lib/project.api.28.io.js on lines 1060..1137
                                                lib/project.api.28.io.js on lines 1336..1413
                                                lib/queries.api.28.io.js on lines 31..108
                                                lib/queries.api.28.io.js on lines 315..392
                                                lib/queries.api.28.io.js on lines 604..681
                                                lib/queries.api.28.io.js on lines 690..767

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

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

                                                    Account.prototype.checkResetToken = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 17 other locations - About 3 days to fix
                                                lib/account.api.28.io.js on lines 225..302
                                                lib/account.api.28.io.js on lines 493..570
                                                lib/account.api.28.io.js on lines 761..838
                                                lib/account.api.28.io.js on lines 847..924
                                                lib/account.api.28.io.js on lines 1120..1197
                                                lib/datasources.api.28.io.js on lines 109..186
                                                lib/modules.api.28.io.js on lines 129..206
                                                lib/project.api.28.io.js on lines 378..455
                                                lib/project.api.28.io.js on lines 464..541
                                                lib/project.api.28.io.js on lines 646..723
                                                lib/project.api.28.io.js on lines 732..809
                                                lib/project.api.28.io.js on lines 1060..1137
                                                lib/project.api.28.io.js on lines 1336..1413
                                                lib/queries.api.28.io.js on lines 31..108
                                                lib/queries.api.28.io.js on lines 315..392
                                                lib/queries.api.28.io.js on lines 604..681
                                                lib/queries.api.28.io.js on lines 690..767

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

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

                                                    Account.prototype.checkAccount = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 2 other locations - About 2 days to fix
                                                lib/account.api.28.io.js on lines 416..484
                                                lib/project.api.28.io.js on lines 301..369

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

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

                                                    Account.prototype.resendConfirmation = function(parameters) {
                                                        if (parameters === undefined) {
                                                            parameters = {};
                                                        }
                                                        var deferred = Q.defer();
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 2 other locations - About 2 days to fix
                                                lib/account.api.28.io.js on lines 148..216
                                                lib/project.api.28.io.js on lines 301..369

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

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

                                                    function Account(options) {
                                                        var domain = (typeof options === 'object') ? options.domain : options;
                                                        this.domain = domain ? domain : 'http://api.xbrl.io';
                                                        if (this.domain.length === 0) {
                                                            throw new Error('Domain parameter must be specified as a string.');
                                                Severity: Major
                                                Found in lib/account.api.28.io.js and 6 other locations - About 2 hrs to fix
                                                lib/auth.api.28.io.js on lines 15..21
                                                lib/batch.api.28.io.js on lines 15..21
                                                lib/datasources.api.28.io.js on lines 15..21
                                                lib/modules.api.28.io.js on lines 15..21
                                                lib/project.api.28.io.js on lines 110..116
                                                lib/queries.api.28.io.js on lines 15..21

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

                                                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

                                                There are no issues that match your filters.

                                                Category
                                                Status