Asymmetrik/mean2-starter

View on GitHub

Showing 230 of 230 total issues

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

UserAgreementSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
    return query.search(this, queryTerms, searchTerms, limit, offset, sortArr);
};
Severity: Minor
Found in src/server/app/admin/models/eua.server.model.js and 2 other locations - About 40 mins to fix
src/server/app/teams/models/tags.server.model.js on lines 67..69
src/server/app/teams/models/team.server.model.js on lines 89..91

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

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

    if(app.locals.developmentMode) {
        app.locals.webpackDevServer = `${config.app.baseUrlWithoutPort}:${config.devPorts.webpack}`;
    }
Severity: Minor
Found in src/server/lib/express.js and 1 other location - About 40 mins to fix
src/server/lib/express.js on lines 46..48

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

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

    if (config.liveReload) {
        app.locals.liveReloadScript = `${config.app.baseUrlWithoutPort}:${config.liveReload.port}/livereload.js`;
    }
Severity: Minor
Found in src/server/lib/express.js and 1 other location - About 40 mins to fix
src/server/lib/express.js on lines 40..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 48.

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

let path = require('path'),

    deps = require(path.resolve('./src/server/dependencies.js')),
    dbs = deps.dbs,
    logger = deps.logger,
Severity: Minor
Found in src/server/app/audit/controllers/audit.server.controller.js and 1 other location - About 40 mins to fix
src/server/app/access-checker/controllers/access-checker.server.controller.js on lines 4..13

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

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

        s.on('error', (err) => {
            logger.error(err, 'CSV export error occurred');

            // End the download
            res.end();
src/server/app/util/controllers/export-config.server.controller.js on lines 116..121

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

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

TagSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
    return query.search(this, queryTerms, searchTerms, limit, offset, sortArr);
};
Severity: Minor
Found in src/server/app/teams/models/tags.server.model.js and 2 other locations - About 40 mins to fix
src/server/app/admin/models/eua.server.model.js on lines 66..68
src/server/app/teams/models/team.server.model.js on lines 89..91

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

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

        s.on('error', (err) => {
            logger.error(err, 'Plaintext export error occurred');

            // End the download
            res.end();
src/server/app/util/controllers/export-config.server.controller.js on lines 76..81

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

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
    path = require('path'),

    deps = require(path.resolve('./src/server/dependencies.js')),
    dbs = deps.dbs,
src/server/app/audit/controllers/audit.server.controller.js on lines 3..10

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

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

TeamSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
    return query.search(this, queryTerms, searchTerms, limit, offset, sortArr);
};
Severity: Minor
Found in src/server/app/teams/models/team.server.model.js and 2 other locations - About 40 mins to fix
src/server/app/admin/models/eua.server.model.js on lines 66..68
src/server/app/teams/models/tags.server.model.js on lines 67..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 48.

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 audit has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    audit: function(message, eventType, eventAction, eventActor, eventObject) {
Severity: Minor
Found in src/server/lib/bunyan.js - About 35 mins to fix

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

    exports.exportCSV = function(req, res, filename, columns, data) {
    Severity: Minor
    Found in src/server/app/util/controllers/export-config.server.controller.js - About 35 mins to fix

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

      MessageSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
      Severity: Minor
      Found in src/server/app/messages/models/message.server.model.js - About 35 mins to fix

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

        UserSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
        Severity: Minor
        Found in src/server/app/admin/models/user.server.model.js - About 35 mins to fix

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

          CacheEntrySchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
          Severity: Minor
          Found in src/server/app/access-checker/models/cache-entry.server.model.js - About 35 mins to fix

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

            TeamSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
            Severity: Minor
            Found in src/server/app/teams/models/team.server.model.js - About 35 mins to fix

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

              TagSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
              Severity: Minor
              Found in src/server/app/teams/models/tags.server.model.js - About 35 mins to fix

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

                    function addMemberToTeam(user, team, role, requester, headers) {
                Severity: Minor
                Found in src/server/app/teams/services/teams.server.service.js - About 35 mins to fix

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

                      function updateMemberRole(user, team, role, requester, headers) {
                  Severity: Minor
                  Found in src/server/app/teams/services/teams.server.service.js - About 35 mins to fix

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

                    AuditSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
                    Severity: Minor
                    Found in src/server/app/audit/models/audit.server.model.js - About 35 mins to fix

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

                      UserAgreementSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
                      Severity: Minor
                      Found in src/server/app/admin/models/eua.server.model.js - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language