igor-starostenko/report_factory-web

View on GitHub

Showing 232 of 232 total issues

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

export const getUserReports = (userId, xApiKey) => {
  const request = usersClient.getAllUserReports(userId, xApiKey);

  return {
    type: GET_USER_REPORTS,
Severity: Major
Found in src/actions/users_actions.js and 15 other locations - About 1 hr to fix
src/actions/project_reports_actions.js on lines 21..28
src/actions/projects_actions.js on lines 17..24
src/actions/projects_actions.js on lines 26..33
src/actions/projects_actions.js on lines 49..56
src/actions/projects_actions.js on lines 60..67
src/actions/projects_actions.js on lines 88..95
src/actions/reports_actions.js on lines 19..26
src/actions/reports_actions.js on lines 28..35
src/actions/reports_actions.js on lines 42..49
src/actions/reports_actions.js on lines 51..58
src/actions/scenarios_actions.js on lines 43..50
src/actions/users_actions.js on lines 81..88
src/actions/users_actions.js on lines 113..120
src/actions/users_actions.js on lines 124..131
src/actions/users_actions.js on lines 154..161

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

export const createUser = (attributes, xApiKey) => {
  const request = usersClient.createUser(attributes, xApiKey);

  return {
    type: EDIT_USER,
Severity: Major
Found in src/actions/users_actions.js and 15 other locations - About 1 hr to fix
src/actions/project_reports_actions.js on lines 21..28
src/actions/projects_actions.js on lines 17..24
src/actions/projects_actions.js on lines 26..33
src/actions/projects_actions.js on lines 49..56
src/actions/projects_actions.js on lines 60..67
src/actions/projects_actions.js on lines 88..95
src/actions/reports_actions.js on lines 19..26
src/actions/reports_actions.js on lines 28..35
src/actions/reports_actions.js on lines 42..49
src/actions/reports_actions.js on lines 51..58
src/actions/scenarios_actions.js on lines 43..50
src/actions/users_actions.js on lines 81..88
src/actions/users_actions.js on lines 95..102
src/actions/users_actions.js on lines 113..120
src/actions/users_actions.js on lines 154..161

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

export const queryProject = (xApiKey, filters) => {
  const request = projectsClient.queryProject(xApiKey, filters);

  return {
    type: PROJECT,
Severity: Major
Found in src/actions/projects_actions.js and 15 other locations - About 1 hr to fix
src/actions/project_reports_actions.js on lines 21..28
src/actions/projects_actions.js on lines 17..24
src/actions/projects_actions.js on lines 49..56
src/actions/projects_actions.js on lines 60..67
src/actions/projects_actions.js on lines 88..95
src/actions/reports_actions.js on lines 19..26
src/actions/reports_actions.js on lines 28..35
src/actions/reports_actions.js on lines 42..49
src/actions/reports_actions.js on lines 51..58
src/actions/scenarios_actions.js on lines 43..50
src/actions/users_actions.js on lines 81..88
src/actions/users_actions.js on lines 95..102
src/actions/users_actions.js on lines 113..120
src/actions/users_actions.js on lines 124..131
src/actions/users_actions.js on lines 154..161

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

export const getProject = (name, xApiKey) => {
  const request = projectsClient.showProject(name, xApiKey);

  return {
    type: GET_PROJECT,
Severity: Major
Found in src/actions/projects_actions.js and 15 other locations - About 1 hr to fix
src/actions/project_reports_actions.js on lines 21..28
src/actions/projects_actions.js on lines 17..24
src/actions/projects_actions.js on lines 26..33
src/actions/projects_actions.js on lines 60..67
src/actions/projects_actions.js on lines 88..95
src/actions/reports_actions.js on lines 19..26
src/actions/reports_actions.js on lines 28..35
src/actions/reports_actions.js on lines 42..49
src/actions/reports_actions.js on lines 51..58
src/actions/scenarios_actions.js on lines 43..50
src/actions/users_actions.js on lines 81..88
src/actions/users_actions.js on lines 95..102
src/actions/users_actions.js on lines 113..120
src/actions/users_actions.js on lines 124..131
src/actions/users_actions.js on lines 154..161

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

        <div className={styles.reportsSearch}>
          <SearchReports
            action={fetchRspecReports}
            setSearch={resetSearchTags}
            initialValues={{ tags: query.tags }}
Severity: Major
Found in src/containers/reports.jsx and 1 other location - About 1 hr to fix
src/containers/project_rspec_reports.jsx on lines 58..65

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

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

        <div className={styles.projectReportsSearch}>
          <SearchReports
            action={fetchProjectRspecReports}
            setSearch={resetSearchTags}
            initialValues={{ tags: query.tags }}
Severity: Major
Found in src/containers/project_rspec_reports.jsx and 1 other location - About 1 hr to fix
src/containers/reports.jsx on lines 52..59

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

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

Function Navigation has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Navigation(props) {
  const [isOpen, setOpen] = useState(false);

  function toggle() {
    setOpen(!isOpen);
Severity: Minor
Found in src/components/navigation.jsx - About 1 hr to fix

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

            <div className="formButtons">
              <Button type="submit" color="primary">
                {submitText}
              </Button>
              <Button to={backPath}>Cancel</Button>
    Severity: Major
    Found in src/containers/edit_project_form.jsx and 1 other location - About 1 hr to fix
    src/containers/edit_user_form.jsx on lines 78..83

    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

    export const getProjects = xApiKey => {
      const request = projectsClient.getAllProjects(xApiKey);
    
      return {
        type: GET_PROJECTS,
    Severity: Major
    Found in src/actions/projects_actions.js and 2 other locations - About 1 hr to fix
    src/actions/scenarios_actions.js on lines 11..18
    src/actions/users_actions.js on lines 104..111

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

    UserListItem.propTypes = {
      name: PropTypes.string.isRequired,
      email: PropTypes.string.isRequired,
      type: PropTypes.string.isRequired,
      id: PropTypes.string.isRequired,
    Severity: Major
    Found in src/containers/users.jsx and 4 other locations - About 1 hr to fix
    src/components/pagination.jsx on lines 61..66
    src/components/pagination_connection.jsx on lines 103..108
    src/containers/update_project.jsx on lines 43..48
    src/containers/update_user.jsx on lines 97..102

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

    DeleteProjectModal.propTypes = {
      projectName: PropTypes.string.isRequired,
      handleDelete: PropTypes.func.isRequired,
      isOpen: PropTypes.bool.isRequired,
      toggle: PropTypes.func.isRequired,
    Severity: Major
    Found in src/containers/update_project.jsx and 4 other locations - About 1 hr to fix
    src/components/pagination.jsx on lines 61..66
    src/components/pagination_connection.jsx on lines 103..108
    src/containers/update_user.jsx on lines 97..102
    src/containers/users.jsx on lines 29..34

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

    PaginationConnection.propTypes = {
      setPage: PropTypes.func.isRequired,
      page: PropTypes.number.isRequired,
      perPage: PropTypes.number.isRequired,
      totalCount: PropTypes.number.isRequired,
    Severity: Major
    Found in src/components/pagination_connection.jsx and 4 other locations - About 1 hr to fix
    src/components/pagination.jsx on lines 61..66
    src/containers/update_project.jsx on lines 43..48
    src/containers/update_user.jsx on lines 97..102
    src/containers/users.jsx on lines 29..34

    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

    export const queryScenarios = xApiKey => {
      const request = scenariosClient.queryScenarios(xApiKey);
    
      return {
        type: SCENARIOS,
    Severity: Major
    Found in src/actions/scenarios_actions.js and 2 other locations - About 1 hr to fix
    src/actions/projects_actions.js on lines 40..47
    src/actions/users_actions.js on lines 104..111

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

    Pagination.propTypes = {
      page: PropTypes.number.isRequired,
      perPage: PropTypes.number.isRequired,
      total: PropTypes.number.isRequired,
      setPage: PropTypes.func.isRequired,
    Severity: Major
    Found in src/components/pagination.jsx and 4 other locations - About 1 hr to fix
    src/components/pagination_connection.jsx on lines 103..108
    src/containers/update_project.jsx on lines 43..48
    src/containers/update_user.jsx on lines 97..102
    src/containers/users.jsx on lines 29..34

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

    DeleteUserModal.propTypes = {
      isOpen: PropTypes.bool.isRequired,
      toggle: PropTypes.func.isRequired,
      handleDelete: PropTypes.func.isRequired,
      userName: PropTypes.string.isRequired,
    Severity: Major
    Found in src/containers/update_user.jsx and 4 other locations - About 1 hr to fix
    src/components/pagination.jsx on lines 61..66
    src/components/pagination_connection.jsx on lines 103..108
    src/containers/update_project.jsx on lines 43..48
    src/containers/users.jsx on lines 29..34

    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

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

            <div className="formButtons">
              <Button type="submit" color="primary">
                {submitText}
              </Button>
              <Button to={backPath}>Cancel</Button>
    Severity: Major
    Found in src/containers/edit_user_form.jsx and 1 other location - About 1 hr to fix
    src/containers/edit_project_form.jsx on lines 49..54

    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

    export const getUsers = xApiKey => {
      const request = usersClient.getAllUsers(xApiKey);
    
      return {
        type: GET_USERS,
    Severity: Major
    Found in src/actions/users_actions.js and 2 other locations - About 1 hr to fix
    src/actions/projects_actions.js on lines 40..47
    src/actions/scenarios_actions.js on lines 11..18

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

    const mapStateToProps = state => ({
      userId: getValue(state.users.currentUser, 'data.id'),
      loading: state.users.currentUser.loading,
      xApiKey: state.users.currentUser.xApiKey,
    });
    Severity: Major
    Found in src/containers/app.jsx and 1 other location - About 1 hr to fix
    src/containers/authentication.jsx on lines 50..54

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

      const mapStateToProps = state => ({
        userId: getValue(state.users.currentUser, 'data.id'),
        authError: state.users.currentUser.error,
        xApiKey: state.users.currentUser.xApiKey,
      });
    Severity: Major
    Found in src/containers/authentication.jsx and 1 other location - About 1 hr to fix
    src/containers/app.jsx on lines 70..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 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

    Function ProjectScenarios has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ProjectScenarios(props) {
      useEffect(() => {
        props.setScenarios();
      }, []);
    
    
    Severity: Minor
    Found in src/components/project_scenarios.jsx - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language