AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

        $.ajax({
            url: 'index.php?module=intern&action=HostRest&Waiting=true',
            type: 'GET',
            dataType: 'json',
            success: function(data) {
Severity: Major
Found in javascript/location/Location.jsx and 1 other location - About 3 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 265..275

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

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Relation {require}</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="emg-relation" ref="emg_relation" defaultValue={this.props.relation} /></div>
                        </div>
Severity: Major
Found in javascript/emergencyContact/EmgContactList.jsx and 7 other locations - About 3 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 129..132
javascript/specialHost/ApproveHost.jsx on lines 81..84
javascript/specialHost/ApproveHost.jsx on lines 188..191
javascript/specialHost/ApproveHost.jsx on lines 192..195
javascript/specialHost/ApproveHost.jsx on lines 196..199
javascript/specialHost/ApproveHost.jsx on lines 200..203
javascript/specialHost/ApproveHost.jsx on lines 278..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 97.

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Sub Name {require}</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-name" ref="host_name" defaultValue={this.props.name}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 7 other locations - About 3 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 129..132
javascript/emergencyContact/EmgContactList.jsx on lines 133..136
javascript/specialHost/ApproveHost.jsx on lines 188..191
javascript/specialHost/ApproveHost.jsx on lines 192..195
javascript/specialHost/ApproveHost.jsx on lines 196..199
javascript/specialHost/ApproveHost.jsx on lines 200..203
javascript/specialHost/ApproveHost.jsx on lines 278..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 97.

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Stop Level {require}</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="stop" ref="stop_level" defaultValue={this.props.stop}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 7 other locations - About 3 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 129..132
javascript/emergencyContact/EmgContactList.jsx on lines 133..136
javascript/specialHost/ApproveHost.jsx on lines 81..84
javascript/specialHost/ApproveHost.jsx on lines 188..191
javascript/specialHost/ApproveHost.jsx on lines 196..199
javascript/specialHost/ApproveHost.jsx on lines 200..203
javascript/specialHost/ApproveHost.jsx on lines 278..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 97.

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 _getJoinOn has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _getJoinOn($join_on_1, $join_on_2, $table1, $table2, $ignore_tables = false)
    {
        if (empty($join_on_1) || empty($join_on_2)) {
            return null;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function saveObject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveObject($object, $stripChar = false, $autodetect_id = true)
    {
        if (!is_object($object)) {
            return PHPWS_Error::get(PHPWS_WRONG_TYPE, 'core', 'PHPWS_DB::saveObject', _('Type') . ': ' . gettype($object));
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File editAdmin.jsx has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import {CSSTransition} from 'react-transition-group'

Severity: Minor
Found in javascript/editAdmin/editAdmin.jsx - About 3 hrs to fix

File EmgContactList.jsx has 293 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import {Button, Modal} from 'react-bootstrap';
import Message from './Message.jsx';
Severity: Minor
Found in javascript/emergencyContact/EmgContactList.jsx - About 3 hrs to fix

File ContractAffiliation.jsx has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import Dropzone from 'react-dropzone';
import $ from 'jquery';
import classNames from 'classnames';
Severity: Minor
Found in javascript/contractAffiliation/ContractAffiliation.jsx - About 3 hrs to fix

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

        } else if(form.elements.location.value === 'international') {
            if(form.elements.country.value === '-1') {
                thisComponent.refs.locationBlock.countryDropDown.setError(true);
                errors.push('Country');
                valid = false;
Severity: Major
Found in javascript/createInterface/CreateInternshipInterface.jsx and 1 other location - About 3 hrs to fix
javascript/createInterface/CreateInternshipInterface.jsx on lines 134..150

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

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

        if(form.elements.location.value === 'domestic'){
            if(form.elements.state.value === '-1'){
                thisComponent.refs.locationBlock.stateDropDown.setError(true);
                errors.push('State');
                valid = false;
Severity: Major
Found in javascript/createInterface/CreateInternshipInterface.jsx and 1 other location - About 3 hrs to fix
javascript/createInterface/CreateInternshipInterface.jsx on lines 142..150

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

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

File InternshipInventory.php has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * This file is part of Internship Inventory.
 *
 * Internship Inventory is free software: you can redistribute it and/or modify
Severity: Minor
Found in class/InternshipInventory.php - About 2 hrs to fix

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Country</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-country" ref="host_country" defaultValue={this.props.country}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 10 other locations - About 2 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 150..153
javascript/specialHost/ApproveHost.jsx on lines 85..88
javascript/specialHost/ApproveHost.jsx on lines 89..92
javascript/specialHost/ApproveHost.jsx on lines 93..96
javascript/specialHost/ApproveHost.jsx on lines 97..100
javascript/specialHost/ApproveHost.jsx on lines 101..104
javascript/specialHost/ApproveHost.jsx on lines 109..112
javascript/specialHost/ApproveHost.jsx on lines 204..207
javascript/specialHost/ApproveHost.jsx on lines 208..211
javascript/specialHost/ApproveHost.jsx on lines 297..300

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

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Province</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-province" ref="host_province" defaultValue={this.props.province}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 10 other locations - About 2 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 150..153
javascript/specialHost/ApproveHost.jsx on lines 85..88
javascript/specialHost/ApproveHost.jsx on lines 89..92
javascript/specialHost/ApproveHost.jsx on lines 93..96
javascript/specialHost/ApproveHost.jsx on lines 97..100
javascript/specialHost/ApproveHost.jsx on lines 105..108
javascript/specialHost/ApproveHost.jsx on lines 109..112
javascript/specialHost/ApproveHost.jsx on lines 204..207
javascript/specialHost/ApproveHost.jsx on lines 208..211
javascript/specialHost/ApproveHost.jsx on lines 297..300

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

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

    onSearchListChange(e) {
        var name = null;
        name = e.target.value.toLowerCase();
        this.setState({searchName: name});
        this.updateDisplayData(name, this.state.sortBy, this.state.showFilter, this.state.mainData, 'mainDisplayData');
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 2 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 714..719

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

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Zip/Postal</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-zip" ref="host_zip" defaultValue={this.props.zip}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 10 other locations - About 2 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 150..153
javascript/specialHost/ApproveHost.jsx on lines 85..88
javascript/specialHost/ApproveHost.jsx on lines 89..92
javascript/specialHost/ApproveHost.jsx on lines 93..96
javascript/specialHost/ApproveHost.jsx on lines 101..104
javascript/specialHost/ApproveHost.jsx on lines 105..108
javascript/specialHost/ApproveHost.jsx on lines 109..112
javascript/specialHost/ApproveHost.jsx on lines 204..207
javascript/specialHost/ApproveHost.jsx on lines 208..211
javascript/specialHost/ApproveHost.jsx on lines 297..300

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

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">City</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-city" ref="host_city" defaultValue={this.props.city}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 10 other locations - About 2 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 150..153
javascript/specialHost/ApproveHost.jsx on lines 85..88
javascript/specialHost/ApproveHost.jsx on lines 93..96
javascript/specialHost/ApproveHost.jsx on lines 97..100
javascript/specialHost/ApproveHost.jsx on lines 101..104
javascript/specialHost/ApproveHost.jsx on lines 105..108
javascript/specialHost/ApproveHost.jsx on lines 109..112
javascript/specialHost/ApproveHost.jsx on lines 204..207
javascript/specialHost/ApproveHost.jsx on lines 208..211
javascript/specialHost/ApproveHost.jsx on lines 297..300

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

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Supervisor</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="sup" ref="sup_check" defaultValue={this.props.sup}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 10 other locations - About 2 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 150..153
javascript/specialHost/ApproveHost.jsx on lines 85..88
javascript/specialHost/ApproveHost.jsx on lines 89..92
javascript/specialHost/ApproveHost.jsx on lines 93..96
javascript/specialHost/ApproveHost.jsx on lines 97..100
javascript/specialHost/ApproveHost.jsx on lines 101..104
javascript/specialHost/ApproveHost.jsx on lines 105..108
javascript/specialHost/ApproveHost.jsx on lines 109..112
javascript/specialHost/ApproveHost.jsx on lines 208..211
javascript/specialHost/ApproveHost.jsx on lines 297..300

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

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Notes</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="notes" ref="notes" defaultValue={this.props.notes}/></div>
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 10 other locations - About 2 hrs to fix
javascript/emergencyContact/EmgContactList.jsx on lines 150..153
javascript/specialHost/ApproveHost.jsx on lines 85..88
javascript/specialHost/ApproveHost.jsx on lines 89..92
javascript/specialHost/ApproveHost.jsx on lines 93..96
javascript/specialHost/ApproveHost.jsx on lines 97..100
javascript/specialHost/ApproveHost.jsx on lines 101..104
javascript/specialHost/ApproveHost.jsx on lines 105..108
javascript/specialHost/ApproveHost.jsx on lines 109..112
javascript/specialHost/ApproveHost.jsx on lines 204..207
javascript/specialHost/ApproveHost.jsx on lines 297..300

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

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

    onSearchHostListChange(e) {
        var name = null;
        name = e.target.value.toLowerCase();
        this.setState({searchHostName: name});
        this.updateDisplayData(name, this.state.sortHostBy, this.state.showHostFilter, this.state.hostConData, 'hostDisplayData');
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 2 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 708..713

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

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