Showing 56 of 56 total issues

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

    Client.prototype.writeLocalQuery = function(diff){
        return this.vfs.writeLocalQuery(diff.query).then(function(){ logDiff(diff); });
    };
Severity: Major
Found in lib/sync.js and 2 other locations - About 1 hr to fix
lib/sync.js on lines 139..141
lib/sync.js on lines 143..145

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

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

    Client.prototype.deleteLocalQuery = function(diff){
        return this.vfs.deleteLocalQuery(diff.query).then(function(){ logDiff(diff); });
    };
Severity: Major
Found in lib/sync.js and 2 other locations - About 1 hr to fix
lib/sync.js on lines 124..126
lib/sync.js on lines 143..145

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {
  
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
 
    grunt.initConfig({
Severity: Minor
Found in Gruntfile.js - About 1 hr to fix

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

        $28.prototype.setCustomRewriteRules = function(projectName, token, customRewrites) {
            return this.api.Project.setCustomRewriteRules({ projectName: projectName, token: token, customRewrites: customRewrites });
        };
    Severity: Major
    Found in lib/28.js and 1 other location - About 1 hr to fix
    lib/28.js on lines 61..67

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 58.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        $28.prototype.resetPassword = function(email, password, token) {
            return this.api.Account.updateAccount({
                email: email,
                password: password,
                token: token
    Severity: Major
    Found in lib/28.js and 1 other location - About 1 hr to fix
    lib/28.js on lines 105..107

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 58.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function sync has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        $28.prototype.sync = function(type, projectEndpoint, projectToken, localProjectPath, overwrite, deleteOrphaned, simulate, ignore, concurrency) {
    Severity: Major
    Found in lib/28.js - About 1 hr to fix

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

          $28.prototype.login = function(email, password) {
              return this.api.Auth.authenticate({
                  email: email,
                  password: password,
                  grant_type: 'client_credentials'
      Severity: Major
      Found in lib/28.js and 1 other location - About 1 hr to fix
      lib/28.js on lines 45..51

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

      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

          $28.prototype.refreshTokens = function(email, token){
              return this.api.Auth.authenticate({
                  email: email,
                  refresh_token: token,
                  grant_type: 'refresh_token'
      Severity: Major
      Found in lib/28.js and 1 other location - About 1 hr to fix
      lib/28.js on lines 53..59

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function VFS has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      var VFS = (function(){
      
          var isModule = function(path) {
              return path.substring(0, 'modules'.length) === 'modules';
          };
      Severity: Minor
      Found in lib/vfs.js - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          Config.prototype.refreshTokens = function (projectName) {
              var $28 = this.getAPIClient();
              var that = this;
              var exp = new Date(this.config.expiration_date).getTime();
              var now = new Date().getTime();
      Severity: Minor
      Found in lib/config.js - About 1 hr to fix

        Function download has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            $28.prototype.download = function(projectEndpoint, projectToken, localProjectPath, overwrite, deleteOrphaned, simulate, ignore, concurrency) {
        Severity: Major
        Found in lib/28.js - About 1 hr to fix

          Function upload has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              $28.prototype.upload = function(projectEndpoint, projectToken, localProjectPath, overwrite, deleteOrphaned, simulate, ignore, concurrency) {
          Severity: Major
          Found in lib/28.js - About 1 hr to fix

            Function updateDefaultMongoDBCredentials has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    projectName, token, dbType, connString, db, username, password, preDigested
            Severity: Major
            Found in lib/28.js - About 1 hr to fix

              Function updateDatasource has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  $28.prototype.updateDatasource = function(projectEndpoint, name, category, newname, token, difault, credentials){
              Severity: Major
              Found in lib/28.js - About 50 mins to fix

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

                    $28.prototype.upgradeProject = function(name, token) {
                        return this.api.Project.upgradeProject({
                            projectName: name,
                            token: token
                        });
                Severity: Major
                Found in lib/28.js and 3 other locations - About 50 mins to fix
                lib/28.js on lines 90..95
                lib/28.js on lines 101..103
                lib/28.js on lines 142..147

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

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

                    $28.prototype.getCustomRewriteRules = function(projectName, token){
                        return this.api.Project.getCustomRewriteRules({ projectName: projectName, token: token });
                    };
                Severity: Major
                Found in lib/28.js and 3 other locations - About 50 mins to fix
                lib/28.js on lines 75..80
                lib/28.js on lines 90..95
                lib/28.js on lines 142..147

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

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

                    $28.prototype.deleteProject = function(projectName, token){
                        return this.api.Project.deleteProject({
                            projectName: projectName,
                            token: token
                        });
                Severity: Major
                Found in lib/28.js and 3 other locations - About 50 mins to fix
                lib/28.js on lines 75..80
                lib/28.js on lines 101..103
                lib/28.js on lines 142..147

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

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

                    $28.prototype.getDefaultMongoDBCredentials = function(projectName, token){
                        return this.api.Project.getDefaultMongoDBCredentials({
                            projectName: projectName,
                            token: token
                        });
                Severity: Major
                Found in lib/28.js and 3 other locations - About 50 mins to fix
                lib/28.js on lines 75..80
                lib/28.js on lines 90..95
                lib/28.js on lines 101..103

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

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                    Client.prototype.syncImpl = function(localQueries, remoteQueries, overwrite, deleteOrphaned, simulate, isOriginRemote){
                Severity: Minor
                Found in lib/sync.js - About 45 mins to fix

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

                              monitor.on('removed', function (f) {
                                  deferred.notify({
                                      name: 'remove',
                                      localProjectPath: localProjectPath,
                                      vfs: vfs,
                  Severity: Major
                  Found in lib/commands/watch.js and 2 other locations - About 45 mins to fix
                  lib/commands/watch.js on lines 53..60
                  lib/commands/watch.js on lines 62..69

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

                  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