etnbrd/flx-compiler

View on GitHub
test-set/express-couchUser-master/index.js

Summary

Maintainability
F
1 wk
Test Coverage

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

module.exports = function(config) {
  var app = express(),
    safeUserFields = config.safeUserFields ? config.safeUserFields : "name email roles",
    db;

Severity: Major
Found in test-set/express-couchUser-master/index.js - About 2 days to fix

    Function exports has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(config) {
      var app = express(),
        safeUserFields = config.safeUserFields ? config.safeUserFields : "name email roles",
        db;
    
    
    Severity: Minor
    Found in test-set/express-couchUser-master/index.js - About 7 hrs 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 index.js has 413 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // # expressUserCouchDb
    //
    // This module is an express plugin module, which means you can
    // require the module in your express app, and add it to your express
    // application by using `app.use(user(config));`
    Severity: Minor
    Found in test-set/express-couchUser-master/index.js - About 5 hrs to fix

      Function validateUserByEmail has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function validateUserByEmail(email) {
              var user;
              // use email address to find user
              db.view('user', 'all', { key: email }, saveUserVerificationDetails);
      
      
      Severity: Minor
      Found in test-set/express-couchUser-master/index.js - About 1 hr to fix

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

            function populateSessionWithUser(cb) {
              return function(err, body, headers) {
                if (err) { return cb(err); }
        
                getUserName(body.name, headers['set-cookie'], function(err, name) {
        Severity: Minor
        Found in test-set/express-couchUser-master/index.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                        if (config.adminRoles.indexOf(role) >= 0) { return true; }
          Severity: Major
          Found in test-set/express-couchUser-master/index.js - About 45 mins to fix

            Avoid too many return statements within this function.
            Open

                    return false;
            Severity: Major
            Found in test-set/express-couchUser-master/index.js - About 30 mins to fix

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

                  if (!req.session || !req.session.user) {
                    return res.send(401, JSON.stringify({ok: false, message: "You must be logged in to use this function"}));
                  }
                  else if (config.adminRoles && !hasAdminPermission(req.session.user)) {
                    return res.send(403,JSON.stringify({ok:false, message: "You do not have permission to use this function."}));
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 4 hrs to fix
              test-set/express-couchUser-master/index.js on lines 456..461

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

              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

                  if (!req.session || !req.session.user) {
                    return res.send(401, JSON.stringify({ok:false, message: "You must be logged in to use this function"}));
                  }
                  else if (config.adminRoles && !hasAdminPermission(req.session.user)) {
                    return res.send(403,JSON.stringify({ok:false, message: "You do not have permission to use this function."}));
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 4 hrs to fix
              test-set/express-couchUser-master/index.js on lines 422..427

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

              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

                  db.get('org.couchdb.user:' + req.params.name, function(err,user) {
                    if (err) { return res.send(err.status_code ? err.status_code : 500, err); }
                    return res.send(200, JSON.stringify({ok: true, user: strip(user) }));
                  });
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 2 hrs to fix
              test-set/express-couchUser-master/index.js on lines 301..304

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

              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

                    db.insert(user, user._id, function(err,user) {
                      if (err) { return res.send(err.status_code ? err.status_code : 500, err); }
                      return res.send(200, JSON.stringify({ok: true, user: strip(user) }));
                    });
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 2 hrs to fix
              test-set/express-couchUser-master/index.js on lines 376..379

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

              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

                    transport.sendMail({
                      from: config.email.from,
                      to: user.email,
                      subject: config.app.name + ': Reset Password Request',
                      html: html,
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 556..561

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 62.

              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

                        transport.sendMail({
                          from: config.email.from,
                          to: user.email,
                          subject: config.app.name + ': Please Verify Your Account',
                          html: html,
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 242..247

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

              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

                  if (!req.session || !req.session.user) {
                    return res.send(401,JSON.stringify({ok:false, message: "You must be logged in to use this function"}));
                  }
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 4 other locations - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 196..198
              test-set/express-couchUser-master/index.js on lines 312..314
              test-set/express-couchUser-master/index.js on lines 363..365
              test-set/express-couchUser-master/index.js on lines 372..374

              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

                    if (body.rows && body.rows.length === 0) {
                      return res.send(500, JSON.stringify({ ok: false, message: 'No user found with that email.' }));
                    }
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 294..296

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

                  if (!req.session || !req.session.user) {
                    return res.send(401,JSON.stringify({ok:false, message: "You must be logged in to use this function."}));
                  }
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 4 other locations - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 196..198
              test-set/express-couchUser-master/index.js on lines 312..314
              test-set/express-couchUser-master/index.js on lines 363..365
              test-set/express-couchUser-master/index.js on lines 471..473

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

                    if (!req.session || !req.session.user) {
                      return res.send(401,JSON.stringify({ok:false, message: "Not currently logged in."}));
                    }
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 4 other locations - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 196..198
              test-set/express-couchUser-master/index.js on lines 312..314
              test-set/express-couchUser-master/index.js on lines 372..374
              test-set/express-couchUser-master/index.js on lines 471..473

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

                  if (!req.body || !req.body.email) {
                    return res.send(400, JSON.stringify({ok: false, message: 'An email address is required.'}));
                  }
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 4 other locations - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 312..314
              test-set/express-couchUser-master/index.js on lines 363..365
              test-set/express-couchUser-master/index.js on lines 372..374
              test-set/express-couchUser-master/index.js on lines 471..473

              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

                      if (body.rows && body.rows.length === 0) {
                        return res.send(500, JSON.stringify({ok: false, message: 'Not Found'}));
                      }
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 1 other location - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 209..211

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

                    if (!req.body || !req.body.email) {
                      return res.send(400, JSON.stringify({ok: false, message: 'An email address must be passed as part of the query string before a verification code can be sent.'}));
                    }
              Severity: Major
              Found in test-set/express-couchUser-master/index.js and 4 other locations - About 1 hr to fix
              test-set/express-couchUser-master/index.js on lines 196..198
              test-set/express-couchUser-master/index.js on lines 363..365
              test-set/express-couchUser-master/index.js on lines 372..374
              test-set/express-couchUser-master/index.js on lines 471..473

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

                    if (!req.params.code) {
                      return res.send(400, JSON.stringify({ok: false, message: 'A verification code is required.'}));
                    }
              Severity: Minor
              Found in test-set/express-couchUser-master/index.js and 2 other locations - About 40 mins to fix
              test-set/express-couchUser-master/index.js on lines 260..262
              test-set/express-couchUser-master/index.js on lines 474..474

              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

                if (!req.params.code) {
                  return res.send(500, JSON.stringify({ok: false, message: 'You must provide a code parameter.'}));
                }
              Severity: Minor
              Found in test-set/express-couchUser-master/index.js and 2 other locations - About 40 mins to fix
              test-set/express-couchUser-master/index.js on lines 330..332
              test-set/express-couchUser-master/index.js on lines 474..474

              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

                  if (!req.query.roles) { return res.send(400, JSON.stringify({ok:false, message: 'Roles are required!'})); }
              Severity: Minor
              Found in test-set/express-couchUser-master/index.js and 2 other locations - About 40 mins to fix
              test-set/express-couchUser-master/index.js on lines 260..262
              test-set/express-couchUser-master/index.js on lines 330..332

              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

              There are no issues that match your filters.

              Category
              Status