nzediegwu1/EventManager

View on GitHub
client/src/components/manageFacilityComponent.js

Summary

Maintainability
B
4 hrs
Test Coverage

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

                <ModalFooter
                  type="button"
                  disabled={this.props.disabled}
                  checkValidation={this.handleSubmit}
                  display={this.props.visibility}
Severity: Major
Found in client/src/components/manageFacilityComponent.js and 1 other location - About 1 hr to fix
client/src/components/addEventComponent.js on lines 332..338

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

const mapDispatchToProps = dispatch => ({
  populateFacilities: facilities => dispatch(populateFacilities(facilities)),
  setUndeletedFacilities: data => dispatch(setUndeletedFacilities(data)),
  setSubmitState: submitState => dispatch(setSubmitState(submitState)),
});
Severity: Major
Found in client/src/components/manageFacilityComponent.js and 2 other locations - About 1 hr to fix
client/src/components/centerListComponent.js on lines 13..17
client/src/components/userListComponent.js on lines 13..17

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

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

const inputAttrs = (inputType, inputName, placeholder, className, ref, required) => ({
  inputType,
  inputName,
  placeholder,
  className,
Severity: Minor
Found in client/src/components/manageFacilityComponent.js and 1 other location - About 35 mins to fix
client/src/components/rePasswordComponent.js on lines 7..14

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

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

                <FormGroup
                  image="glyphicons-540-cart-tick.png"
                  alt="centername"
                  inputProps={inputAttrs(
                    'text',
Severity: Major
Found in client/src/components/manageFacilityComponent.js and 12 other locations - About 30 mins to fix
client/src/components/addCenterComponent.js on lines 116..127
client/src/components/addCenterComponent.js on lines 166..177
client/src/components/addCenterComponent.js on lines 178..189
client/src/components/manageFacilityComponent.js on lines 120..131
client/src/components/manageFacilityComponent.js on lines 132..143
client/src/components/rePasswordComponent.js on lines 41..52
client/src/components/signupComponent.js on lines 54..65
client/src/components/signupComponent.js on lines 66..77
client/src/components/signupComponent.js on lines 78..89
client/src/components/signupComponent.js on lines 90..101
client/src/components/signupComponent.js on lines 102..113
client/src/components/signupComponent.js on lines 114..125

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

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

                <FormGroup
                  image="glyphicons-710-list-numbered.png"
                  alt="address"
                  inputProps={inputAttrs(
                    'number',
Severity: Major
Found in client/src/components/manageFacilityComponent.js and 12 other locations - About 30 mins to fix
client/src/components/addCenterComponent.js on lines 116..127
client/src/components/addCenterComponent.js on lines 166..177
client/src/components/addCenterComponent.js on lines 178..189
client/src/components/manageFacilityComponent.js on lines 108..119
client/src/components/manageFacilityComponent.js on lines 120..131
client/src/components/rePasswordComponent.js on lines 41..52
client/src/components/signupComponent.js on lines 54..65
client/src/components/signupComponent.js on lines 66..77
client/src/components/signupComponent.js on lines 78..89
client/src/components/signupComponent.js on lines 90..101
client/src/components/signupComponent.js on lines 102..113
client/src/components/signupComponent.js on lines 114..125

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

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

                <FormGroup
                  image="glyphicons-249-asterisk.png"
                  alt="centerImage"
                  inputProps={inputAttrs(
                    'text',
Severity: Major
Found in client/src/components/manageFacilityComponent.js and 12 other locations - About 30 mins to fix
client/src/components/addCenterComponent.js on lines 116..127
client/src/components/addCenterComponent.js on lines 166..177
client/src/components/addCenterComponent.js on lines 178..189
client/src/components/manageFacilityComponent.js on lines 108..119
client/src/components/manageFacilityComponent.js on lines 132..143
client/src/components/rePasswordComponent.js on lines 41..52
client/src/components/signupComponent.js on lines 54..65
client/src/components/signupComponent.js on lines 66..77
client/src/components/signupComponent.js on lines 78..89
client/src/components/signupComponent.js on lines 90..101
client/src/components/signupComponent.js on lines 102..113
client/src/components/signupComponent.js on lines 114..125

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

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