yoctore/yocto-express

View on GitHub

Showing 28 of 56 total issues

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

      if (_.has(opStore.options, 'server.sslKey') && _.isString(opStore.options.server.sslKey)) {
        // Create buffer of this file
        opStore.options.server.sslKey =
          fs.readFileSync(path.normalize(process.cwd() + '/' + opStore.options.server.sslKey));
      }
Severity: Major
Found in src/index.js and 1 other location - About 3 hrs to fix
src/index.js on lines 645..649

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

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 (_.has(opStore.options, 'server.sslCert') && _.isString(opStore.options.server.sslCert)) {
        // Create buffer of this file
        opStore.options.server.sslCert =
          fs.readFileSync(path.normalize(process.cwd() + '/' + opStore.options.server.sslCert));
      }
Severity: Major
Found in src/index.js and 1 other location - About 3 hrs to fix
src/index.js on lines 638..642

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

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 (_.has(pr, 'prerenderServiceUrl')) {
      // Yes so set url
      prerender.set('prerenderServiceUrl', pr.prerenderServiceUrl);

      // Message
Severity: Major
Found in src/index.js and 1 other location - About 2 hrs to fix
src/index.js on lines 815..826

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

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 (_.has(pr, 'prerenderToken')) {
      // Yes so set
      prerender.set('prerenderToken', pr.prerenderToken);

      // Message
Severity: Major
Found in src/index.js and 1 other location - About 2 hrs to fix
src/index.js on lines 829..840

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

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

        $('.parent').each(function() {
          // mapping
          if ($(this).find('.thide').length !== $(this).find('.child').length) {
            $(this).show();
          }
Severity: Major
Found in docs/scripts/search.js and 1 other location - About 2 hrs to fix
docs/scripts/search.js on lines 22..27

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

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

        $('.parent').each(function() {
          // mapping
          if ($(this).find('.thide').length === $(this).find('.child').length) {
            $(this).hide();
          }
Severity: Major
Found in docs/scripts/search.js and 1 other location - About 2 hrs to fix
docs/scripts/search.js on lines 31..36

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

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 (jwtoken.autoDecryptRequest) {
          // Enable auto decrypt json request
          this.app.use(jwt.autoDecryptRequest());

          // Messsage
Severity: Major
Found in src/index.js and 1 other location - About 1 hr to fix
src/index.js on lines 943..949

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 (jwtoken.autoEncryptRequest) {
          // Enable auto encrypt json request
          this.app.use(jwt.autoEncryptRequest());

          // Messsage
Severity: Major
Found in src/index.js and 1 other location - About 1 hr to fix
src/index.js on lines 952..958

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 (!path.isAbsolute(p)) {
      // Normalize path
      p = path.normalize([ process.cwd(), p ].join('/'));
    }
Severity: Major
Found in src/index.js and 1 other location - About 1 hr to fix
src/index.js on lines 352..355

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

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 (!path.isAbsolute(p)) {
    // Normalize path
    p = path.normalize([ process.cwd(), p ].join('/'));
  }
Severity: Major
Found in src/index.js and 1 other location - About 1 hr to fix
src/index.js on lines 1405..1408

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processRedirect ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processViewEngine ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processCompression ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processSecurity ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processPrettyHTML ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processDirectory ] -',
      'Cannot process config. App is not ready.' ].join(''));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processStackError ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processSession ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processMultipart ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 474..481
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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

  if (!this.isReady()) {
    // Error message
    this.logger.error([ '[ Express.processCookieParser ] -',
      'Cannot process config. App is not ready.' ].join(' '));

Severity: Major
Found in src/index.js and 15 other locations - About 1 hr to fix
src/index.js on lines 217..224
src/index.js on lines 247..254
src/index.js on lines 277..284
src/index.js on lines 310..317
src/index.js on lines 339..346
src/index.js on lines 386..393
src/index.js on lines 443..450
src/index.js on lines 507..514
src/index.js on lines 545..552
src/index.js on lines 574..581
src/index.js on lines 697..704
src/index.js on lines 730..737
src/index.js on lines 780..787
src/index.js on lines 992..999
src/index.js on lines 1044..1051

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

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