bcgov/common-forms-toolkit

View on GitHub

Showing 559 of 559 total issues

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

    if (tiny) {
      return this._models.Submission.query()
        .findById(submissionId)
        .allowGraph('[survey]')
        .withGraphFetched('[survey]')
Severity: Minor
Found in docs/sample/forms/myform/dataService.js and 1 other location - About 50 mins to fix
app/src/forms/common/dataService.js on lines 177..183

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

  async getSubmission(submissionId) {
    return this._models.Submission.query()
      .findById(submissionId)
      .allowGraph('[statuses.statusCode]')
      .withGraphFetched('statuses(orderDescending).[statusCode]')
Severity: Minor
Found in app/src/forms/common/dataService.js and 1 other location - About 50 mins to fix
docs/sample/forms/myform/dataService.js on lines 247..253

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

      light: {
        primary: '#003366',
        textLink: '#1A5A96',
        secondary: '#FCBA19',
        anchor: '#1A5A96',
Severity: Minor
Found in app/frontend/src/plugins/vuetify.js and 1 other location - About 50 mins to fix
app/src/db/migrations/20200529145912_008-settings-request-access.js on lines 9..19

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

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

  static get jsonSchema() {
    return {
      type: 'object',
      required: LocationSchema.required,
      properties: {
Severity: Minor
Found in app/src/forms/attestations/models/submission.js and 1 other location - About 50 mins to fix
app/src/forms/attestations/models/submission.js on lines 33..43

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

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

        config: {
          template: 'access-requested-email.html',
          from: 'MCAD.RegionalOps@gov.bc.ca',
          to: 'NR.CommonServiceShowcase@gov.bc.ca',
          subject: 'Industrial Camps - Access Requested',
app/frontend/src/plugins/vuetify.js on lines 19..29

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

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

  static get jsonSchema() {
    return {
      type: 'object',
      required: SubmissionSchema.required,
      properties: {
Severity: Minor
Found in app/src/forms/attestations/models/submission.js and 1 other location - About 50 mins to fix
app/src/forms/attestations/models/submission.js on lines 504..514

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

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

Avoid deeply nested control flow statements.
Open

              if (includeUserRoles) {
                ur.roles = await this._kcAdminClient.users.listClientRoleMappings({ id: ur.id, clientUniqueId: id });
              }
Severity: Major
Found in app/src/components/keycloakAdminService.js - About 45 mins to fix

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

      _equalTo(a, b) {
        const x = this._copyAndRemoveStamps(a);
        const y = this._copyAndRemoveStamps(b);
        return equal(x, y);
      }
    Severity: Minor
    Found in docs/sample/forms/myform/dataService.js and 1 other location - About 45 mins to fix
    app/src/forms/attestations/dataService.js on lines 28..32

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 50.

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

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

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

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

    Refactorings

    Further Reading

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

      _equalTo(a, b) {
        const x = this._copyAndRemoveStamps(a);
        const y = this._copyAndRemoveStamps(b);
        return equal(x, y);
      }
    Severity: Minor
    Found in app/src/forms/attestations/dataService.js and 1 other location - About 45 mins to fix
    docs/sample/forms/myform/dataService.js on lines 28..32

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 50.

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

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

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

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

    Refactorings

    Further Reading

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

    class Form extends CommonModels.Form {
    
      static get tablePrefix() {
        return PREFIX;
      }
    app/src/forms/attestations/agriseafoodopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/farmopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/forestrysectoroperatorscreening/models/form.js on lines 7..20
    docs/sample/forms/myform/models/form.js on lines 7..20

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

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

    class Form extends CommonModels.Form {
    
      static get tablePrefix() {
        return PREFIX;
      }
    Severity: Major
    Found in app/src/forms/attestations/farmopscreening/models/form.js and 4 other locations - About 40 mins to fix
    app/src/forms/attestations/agriseafoodopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/forestrysectoroperatorscreening/models/form.js on lines 7..20
    app/src/forms/attestations/minesoperatorscreening/models/form.js on lines 7..20
    docs/sample/forms/myform/models/form.js on lines 7..20

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

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

    class Form extends CommonModels.Form {
    
      static get tablePrefix() {
        return PREFIX;
      }
    app/src/forms/attestations/farmopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/forestrysectoroperatorscreening/models/form.js on lines 7..20
    app/src/forms/attestations/minesoperatorscreening/models/form.js on lines 7..20
    docs/sample/forms/myform/models/form.js on lines 7..20

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

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

    class Form extends CommonModels.Form {
    
      static get tablePrefix() {
        return PREFIX;
      }
    app/src/forms/attestations/agriseafoodopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/farmopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/minesoperatorscreening/models/form.js on lines 7..20
    docs/sample/forms/myform/models/form.js on lines 7..20

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

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

    class Form extends CommonModels.Form {
    
      static get tablePrefix() {
        return PREFIX;
      }
    Severity: Major
    Found in docs/sample/forms/myform/models/form.js and 4 other locations - About 40 mins to fix
    app/src/forms/attestations/agriseafoodopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/farmopscreening/models/form.js on lines 7..20
    app/src/forms/attestations/forestrysectoroperatorscreening/models/form.js on lines 7..20
    app/src/forms/attestations/minesoperatorscreening/models/form.js on lines 7..20

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

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

        this._routes.post('/submissions/email', middleware.publicRateLimiter, async (req, res, next) => {
          await this._controller.sendSubmissionEmail(req, res, next);
        });
    Severity: Major
    Found in app/src/forms/attestations/router.js and 9 other locations - About 40 mins to fix
    app/src/forms/attestations/router.js on lines 10..12
    app/src/forms/attestations/router.js on lines 38..40
    app/src/forms/attestations/router.js on lines 42..44
    app/src/forms/attestations/router.js on lines 59..61
    app/src/forms/common/router.js on lines 15..17
    app/src/forms/common/router.js on lines 19..21
    app/src/forms/teammanagement/router.js on lines 19..21
    docs/sample/forms/myform/router.js on lines 10..12
    docs/sample/forms/myform/router.js on lines 38..40

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

        this._routes.get('/submissions/:submissionId/pdf', middleware.publicRateLimiter, async (req, res, next) => {
          await this._controller.generateSubmissionPdf(req, res, next);
        });
    Severity: Major
    Found in app/src/forms/attestations/router.js and 9 other locations - About 40 mins to fix
    app/src/forms/attestations/router.js on lines 10..12
    app/src/forms/attestations/router.js on lines 38..40
    app/src/forms/attestations/router.js on lines 46..48
    app/src/forms/attestations/router.js on lines 59..61
    app/src/forms/common/router.js on lines 15..17
    app/src/forms/common/router.js on lines 19..21
    app/src/forms/teammanagement/router.js on lines 19..21
    docs/sample/forms/myform/router.js on lines 10..12
    docs/sample/forms/myform/router.js on lines 38..40

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

        this._routes.post('/access', middleware.currentUser, async (req, res, next) => {
          await this._controller.processAccessRequest(req, res, next);
        });
    Severity: Major
    Found in app/src/forms/teammanagement/router.js and 9 other locations - About 40 mins to fix
    app/src/forms/attestations/router.js on lines 10..12
    app/src/forms/attestations/router.js on lines 38..40
    app/src/forms/attestations/router.js on lines 42..44
    app/src/forms/attestations/router.js on lines 46..48
    app/src/forms/attestations/router.js on lines 59..61
    app/src/forms/common/router.js on lines 15..17
    app/src/forms/common/router.js on lines 19..21
    docs/sample/forms/myform/router.js on lines 10..12
    docs/sample/forms/myform/router.js on lines 38..40

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

        this._routes.get('/', middleware.publicRateLimiter, async (req, res, next) => {
          await this._controller.read(req, res, next);
        });
    Severity: Major
    Found in docs/sample/forms/myform/router.js and 9 other locations - About 40 mins to fix
    app/src/forms/attestations/router.js on lines 10..12
    app/src/forms/attestations/router.js on lines 38..40
    app/src/forms/attestations/router.js on lines 42..44
    app/src/forms/attestations/router.js on lines 46..48
    app/src/forms/attestations/router.js on lines 59..61
    app/src/forms/common/router.js on lines 15..17
    app/src/forms/common/router.js on lines 19..21
    app/src/forms/teammanagement/router.js on lines 19..21
    docs/sample/forms/myform/router.js on lines 38..40

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

        this._routes.get('/types', middleware.publicRateLimiter, async (req, res, next) => {
          await this._controller.readTypes(req, res, next);
        });
    Severity: Major
    Found in app/src/forms/attestations/router.js and 9 other locations - About 40 mins to fix
    app/src/forms/attestations/router.js on lines 10..12
    app/src/forms/attestations/router.js on lines 38..40
    app/src/forms/attestations/router.js on lines 42..44
    app/src/forms/attestations/router.js on lines 46..48
    app/src/forms/common/router.js on lines 15..17
    app/src/forms/common/router.js on lines 19..21
    app/src/forms/teammanagement/router.js on lines 19..21
    docs/sample/forms/myform/router.js on lines 10..12
    docs/sample/forms/myform/router.js on lines 38..40

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

        this._routes.get('/', middleware.publicRateLimiter, async (req, res, next) => {
          await this._controller.read(req, res, next);
        });
    Severity: Major
    Found in app/src/forms/attestations/router.js and 9 other locations - About 40 mins to fix
    app/src/forms/attestations/router.js on lines 38..40
    app/src/forms/attestations/router.js on lines 42..44
    app/src/forms/attestations/router.js on lines 46..48
    app/src/forms/attestations/router.js on lines 59..61
    app/src/forms/common/router.js on lines 15..17
    app/src/forms/common/router.js on lines 19..21
    app/src/forms/teammanagement/router.js on lines 19..21
    docs/sample/forms/myform/router.js on lines 10..12
    docs/sample/forms/myform/router.js on lines 38..40

    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

    Severity
    Category
    Status
    Source
    Language