neotoma/sync-server

View on GitHub

Showing 278 of 278 total issues

Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

module.exports = function(user, source, storage, contentType, done) {
Severity: Minor
Found in tests/controllers/item/routines/prepareStoreAll.js - About 35 mins to fix

    Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    module.exports = function(user, source, storage, job, done) {
    Severity: Minor
    Found in app/controllers/item/storeAllForUserStorageSource.js - About 35 mins to fix

      Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      module.exports = function(user, storage, path, data, done) {
      Severity: Minor
      Found in app/controllers/item/storeFile.js - About 35 mins to fix

        Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        module.exports = function(res, data, included, errors, status) {
        Severity: Minor
        Found in app/lib/jsonapi/sendResponseDocument.js - About 35 mins to fix

          Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          module.exports = function(req, data, model, method, done) {
          Severity: Minor
          Found in app/lib/jsonapi/validateQueryData.js - About 35 mins to fix

            Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            module.exports = function(app, method, path, middleware, done) {
            Severity: Minor
            Found in app/lib/jsonapi/routeResource.js - About 35 mins to fix

              Function putItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                putItems: function(source, contentType, storage, userStorageAuth, done) {
              Severity: Minor
              Found in app/lib/nock.js - About 35 mins to fix

                Function saveRelationship has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    var saveRelationship = function(document, relationshipName, resourceObject, toMany, done) {
                Severity: Minor
                Found in app/lib/tasks/grunt-data-seed.js - About 35 mins to fix

                  Function new has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    new: function(name, properties, statics, methods, schemaMods) {
                  Severity: Minor
                  Found in app/factories/model.js - About 35 mins to fix

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

                      }, {
                        when: 'storage parameter has no host property',
                        params: [wh.one('user'), { id: 'bar' }, wh.jsonPath, wh.jsonData()],
                        error: 'Parameter storage has no host property'
                      }, {
                    Severity: Minor
                    Found in tests/controllers/item/storeFile.js and 1 other location - About 35 mins to fix
                    tests/controllers/item/storeFile.js on lines 38..42

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

                    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

                      }, {
                        when: 'storage parameter has no id property',
                        params: [wh.one('user'), { foo: 'bar' }, wh.jsonPath, wh.jsonData()],
                        error: 'Parameter storage has no id property'
                      }, {
                    Severity: Minor
                    Found in tests/controllers/item/storeFile.js and 1 other location - About 35 mins to fix
                    tests/controllers/item/storeFile.js on lines 42..46

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

                    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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function(res, error, status) {
                      if (error) {
                        var errors = error.errors;
                    
                        if (!errors) {
                    Severity: Minor
                    Found in app/lib/jsonapi/sendError.js - About 35 mins 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

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

                          try {
                            prepareStoreAll(this.params[0], this.params[1], this.params[2], this.params[3], done);
                          } catch (error) {
                    Severity: Minor
                    Found in tests/controllers/item/storeItemsPage.js and 1 other location - About 35 mins to fix
                    tests/controllers/item/storeAllForUserStorageSourceContentType.js on lines 54..56

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                      var before = function(done) {
                        prepareStoreAll(this.params[0], this.params[1], this.params[2], this.params[3], done);
                      };
                    tests/controllers/item/storeItemsPage.js on lines 59..61

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

                    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

                            } else if (method === 'patch') {
                              it('PATCH requests to ${modelName} respond with status 200 and result in expected changes when related contactVerificationRequest exists');
                              it('PATCH requests to ${modelName} respond with status 200 and result in expected changes when related contactVerificationRequest has createUser and authenticateSession set to true');
                              it('PATCH requests to ${modelName} respond with status 200 and result in expected changes when related contactVerificationRequest has createUser set to true');
                              it('PATCH requests to ${modelName} respond with status 200 and result in expected changes when related contactVerificationRequest has authenticateSession set to true');
                    Severity: Minor
                    Found in tests/routers.js and 1 other location - About 30 mins to fix
                    tests/factories/model.js on lines 2..9

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

                    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

                      var createUserStorageAuth = (done) => {
                        wh.oneSaved('userStorageAuth', {
                          user: user.id,
                          storage: storage.id
                        }, done);
                    Severity: Minor
                    Found in tests/controllers/item/routines/prepareStoreAll.js and 1 other location - About 30 mins to fix
                    tests/controllers/item/routines/prepareStoreAll.js on lines 50..55

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

                    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

                      }, {
                        when: 'no path parameter provided',
                        params: [wh.one('user'), wh.one('storage'), undefined, wh.jsonData()],
                        error: 'Parameter path undefined or null'
                      }, {
                    Severity: Minor
                    Found in tests/controllers/item/storeFile.js and 1 other location - About 30 mins to fix
                    tests/controllers/item/itemsGetUrl.js on lines 62..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 45.

                    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

                      var createUserSourceAuth = (done) => {
                        wh.oneSaved('userSourceAuth', {
                          user: user.id,
                          source: source.id
                        }, done);
                    Severity: Minor
                    Found in tests/controllers/item/routines/prepareStoreAll.js and 1 other location - About 30 mins to fix
                    tests/controllers/item/routines/prepareStoreAll.js on lines 67..72

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

                    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

                      describe('creates new model', function() {
                        it('with toObject method');
                        it('with findOrCreate method');
                        it('with Mongoose transformation');
                        it('with static methods and attributes');
                    Severity: Minor
                    Found in tests/factories/model.js and 1 other location - About 30 mins to fix
                    tests/routers.js on lines 95..102

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

                    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

                      }, {
                        when: 'no userSourceAuth parameter provided',
                        params: [wh.one('source'), wh.one('contentType'), undefined, wh.pagination()],
                        error: 'Parameter userSourceAuth undefined or null'
                      }, {
                    Severity: Minor
                    Found in tests/controllers/item/itemsGetUrl.js and 1 other location - About 30 mins to fix
                    tests/controllers/item/storeFile.js on lines 46..50

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

                    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