datacite/bracco

View on GitHub
app/controllers/providers/show/organizations/new.js

Summary

Maintainability
D
1 day
Test Coverage

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

    searchConsortium(query) {
      let self = this;
      this.store
        .query('provider', {
          query,
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 2 other locations - About 4 hrs to fix
app/controllers/providers/new.js on lines 267..283
app/controllers/providers/show/edit.js on lines 265..281

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

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

    searchRor(query) {
      let self = this;
      this.store
        .query('ror', { query })
        .then(function (organizations) {
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 3 other locations - About 3 hrs to fix
app/controllers/edit.js on lines 23..34
app/controllers/providers/new.js on lines 302..313
app/controllers/providers/show/edit.js on lines 300..311

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

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

    searchCountry(query) {
      let countries = countryList.filter(function (country) {
        return country.name.toLowerCase().startsWith(query.toLowerCase());
      });
      this.set('countries', countries);
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 3 other locations - About 1 hr to fix
app/controllers/edit.js on lines 13..18
app/controllers/providers/new.js on lines 186..191
app/controllers/providers/show/edit.js on lines 184..189

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

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

  init(...args) {
    this._super(...args);

    this.organizations = this.organizations || [];
    this.consortia = this.consortia || [];
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 2 other locations - About 1 hr to fix
app/components/doi-funding-reference.js on lines 19..24
app/controllers/providers/new.js on lines 171..176

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

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

    searchMemberType(query) {
      let memberTypes = memberTypeList.filter(function (memberType) {
        return memberType.startsWith(query.toLowerCase());
      });
      this.set('memberTypes', memberTypes);
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 11 other locations - About 1 hr to fix
app/controllers/providers/new.js on lines 220..227
app/controllers/providers/new.js on lines 232..237
app/controllers/providers/new.js on lines 245..250
app/controllers/providers/new.js on lines 255..262
app/controllers/providers/show/edit.js on lines 218..225
app/controllers/providers/show/edit.js on lines 230..235
app/controllers/providers/show/edit.js on lines 243..248
app/controllers/providers/show/edit.js on lines 253..260
app/controllers/providers/show/organizations/new.js on lines 47..54
app/controllers/providers/show/organizations/new.js on lines 69..74
app/controllers/providers/show/organizations/new.js on lines 79..86

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

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

    searchNonProfitStatus(query) {
      let nonProfitStatuses = nonProfitStatusList.filter(function (
        nonProfitStatus
      ) {
        return nonProfitStatus.startsWith(query.toLowerCase());
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 11 other locations - About 1 hr to fix
app/controllers/providers/new.js on lines 220..227
app/controllers/providers/new.js on lines 232..237
app/controllers/providers/new.js on lines 245..250
app/controllers/providers/new.js on lines 255..262
app/controllers/providers/show/edit.js on lines 218..225
app/controllers/providers/show/edit.js on lines 230..235
app/controllers/providers/show/edit.js on lines 243..248
app/controllers/providers/show/edit.js on lines 253..260
app/controllers/providers/show/organizations/new.js on lines 47..54
app/controllers/providers/show/organizations/new.js on lines 59..64
app/controllers/providers/show/organizations/new.js on lines 69..74

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

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

    searchOrganizationType(query) {
      let organizationTypes = organizationTypeList.filter(function (
        organizationType
      ) {
        return organizationType.startsWith(query.toLowerCase());
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 11 other locations - About 1 hr to fix
app/controllers/providers/new.js on lines 220..227
app/controllers/providers/new.js on lines 232..237
app/controllers/providers/new.js on lines 245..250
app/controllers/providers/new.js on lines 255..262
app/controllers/providers/show/edit.js on lines 218..225
app/controllers/providers/show/edit.js on lines 230..235
app/controllers/providers/show/edit.js on lines 243..248
app/controllers/providers/show/edit.js on lines 253..260
app/controllers/providers/show/organizations/new.js on lines 59..64
app/controllers/providers/show/organizations/new.js on lines 69..74
app/controllers/providers/show/organizations/new.js on lines 79..86

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

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

    searchFocusArea(query) {
      let focusAreas = focusAreaList.filter(function (focusArea) {
        return focusArea.startsWith(query.toLowerCase());
      });
      this.set('focusAreas', focusAreas);
Severity: Major
Found in app/controllers/providers/show/organizations/new.js and 11 other locations - About 1 hr to fix
app/controllers/providers/new.js on lines 220..227
app/controllers/providers/new.js on lines 232..237
app/controllers/providers/new.js on lines 245..250
app/controllers/providers/new.js on lines 255..262
app/controllers/providers/show/edit.js on lines 218..225
app/controllers/providers/show/edit.js on lines 230..235
app/controllers/providers/show/edit.js on lines 243..248
app/controllers/providers/show/edit.js on lines 253..260
app/controllers/providers/show/organizations/new.js on lines 47..54
app/controllers/providers/show/organizations/new.js on lines 59..64
app/controllers/providers/show/organizations/new.js on lines 79..86

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

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

    cancel() {
      this.model.organization.rollbackAttributes();
      this.router.transitionTo(
        'providers.show.organizations',
        this.get('model.provider.id')
Severity: Minor
Found in app/controllers/providers/show/organizations/new.js and 1 other location - About 45 mins to fix
app/controllers/providers/show/repositories/new.js on lines 199..205

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

There are no issues that match your filters.

Category
Status