CLOSER-Cohorts/archivist

View on GitHub
react/src/pages/InstrumentBuild.js

Summary

Maintainability
F
3 days
Test Coverage

Function InstrumentBuild has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const InstrumentBuild = (props) => {

  const dispatch = useDispatch()
  const classes = useStyles();

Severity: Major
Found in react/src/pages/InstrumentBuild.js - About 4 hrs to fix

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

          <Grid item xs={6}>
            <Paper className={classes.control}>
              <h2><Link to={url(routes.instruments.instrument.build.responseDomains.all, { instrument_id: instrumentId })}>ResponseDomains</Link></h2>
              <List dense={true}>
                  <StatCount label="Datetime Answers" value={response_domain_datetimes} />
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 1 other location - About 7 hrs to fix
react/src/pages/InstrumentBuild.js on lines 101..110

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

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

          <Grid item xs={6}>
            <Paper className={classes.control}>
              <h2><Link to={url(routes.instruments.instrument.build.questionItems.all, { instrument_id: instrumentId })}>Questions</Link></h2>
              <List dense={true}>
                  <StatCount label="Question Items" value={question_items} />
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 1 other location - About 7 hrs to fix
react/src/pages/InstrumentBuild.js on lines 91..100

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

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

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

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

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

Refactorings

Further Reading

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

                  <Link to={url(routes.instruments.instrument.build.ccSequences, { instrument_id: instrumentId })}>
                    <StatCount label="Sequences" value={cc_sequences} />
                  </Link>
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 4 other locations - About 1 hr to fix
react/src/pages/InstrumentBuild.js on lines 121..123
react/src/pages/InstrumentBuild.js on lines 124..126
react/src/pages/InstrumentBuild.js on lines 127..129
react/src/pages/InstrumentBuild.js on lines 133..135

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

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

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

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

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

Refactorings

Further Reading

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

                  <Link to={url(routes.instruments.instrument.build.ccQuestions, { instrument_id: instrumentId })}>
                    <StatCount label="Questions" value={cc_questions} />
                  </Link>
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 4 other locations - About 1 hr to fix
react/src/pages/InstrumentBuild.js on lines 121..123
react/src/pages/InstrumentBuild.js on lines 124..126
react/src/pages/InstrumentBuild.js on lines 130..132
react/src/pages/InstrumentBuild.js on lines 133..135

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

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

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

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

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

Refactorings

Further Reading

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

                  <Link to={url(routes.instruments.instrument.build.ccStatements, { instrument_id: instrumentId })}>
                    <StatCount label="Statements" value={cc_statements} />
                  </Link>
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 4 other locations - About 1 hr to fix
react/src/pages/InstrumentBuild.js on lines 121..123
react/src/pages/InstrumentBuild.js on lines 124..126
react/src/pages/InstrumentBuild.js on lines 127..129
react/src/pages/InstrumentBuild.js on lines 130..132

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

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

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

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

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

Refactorings

Further Reading

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

                  <Link to={url(routes.instruments.instrument.build.ccConditions, { instrument_id: instrumentId })}>
                    <StatCount label="Conditions" value={cc_conditions} />
                  </Link>
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 4 other locations - About 1 hr to fix
react/src/pages/InstrumentBuild.js on lines 124..126
react/src/pages/InstrumentBuild.js on lines 127..129
react/src/pages/InstrumentBuild.js on lines 130..132
react/src/pages/InstrumentBuild.js on lines 133..135

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

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

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

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

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

Refactorings

Further Reading

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

                  <Link to={url(routes.instruments.instrument.build.ccLoops, { instrument_id: instrumentId })}>
                    <StatCount label="Loops" value={cc_loops} />
                  </Link>
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 4 other locations - About 1 hr to fix
react/src/pages/InstrumentBuild.js on lines 121..123
react/src/pages/InstrumentBuild.js on lines 127..129
react/src/pages/InstrumentBuild.js on lines 130..132
react/src/pages/InstrumentBuild.js on lines 133..135

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

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

        {instrument && instrument.signed_off && (
          <div>
            <Alert severity="error">
              <AlertTitle>Read Only</AlertTitle>
              Instrument has been signed off so you can only view this as read-only.
Severity: Major
Found in react/src/pages/InstrumentBuild.js and 1 other location - About 1 hr to fix
react/src/components/BuildContainer.js on lines 135..142

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

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
Open

import React, { useEffect } from 'react';
Severity: Minor
Found in react/src/pages/InstrumentBuild.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status