AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

                    <div className="col-md-3">
                        <div className="input-group">
                            <label>Search by Name</label>
                            <input type="text" className="form-control" placeholder="Search for..." onChange={this.onSearchListChange} />
                        </div>
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 2 other locations - About 2 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 943..948
javascript/specialHost/ApproveHost.jsx on lines 1000..1005

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

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

                        <div className="col-md-3">
                            <div className="input-group">
                                <label>Search by Name</label>
                                <input type="text" className="form-control" placeholder="Search for..." onChange={this.onSearchHostListChange} />
                            </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 2 other locations - About 2 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 410..415
javascript/specialHost/ApproveHost.jsx on lines 1000..1005

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

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

                    <div className="col-md-3">
                        <div className="input-group">
                            <label>Search by Name</label>
                            <input type="text" className="form-control" placeholder="Search for..." onChange={this.onSearchListChange} />
                        </div>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 2 other locations - About 2 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 410..415
javascript/specialHost/ApproveHost.jsx on lines 943..948

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

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

            loc = (<div className="form-group">
                <label className="col-lg-3 control-label">City {require}</label>
                <div className="col-lg-9"><input  type="text" className="form-control" id="sub-city" ref="sub_city"/></div>
            </div>);
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 185..188
javascript/createInterface/HostBlock.jsx on lines 189..192
javascript/createInterface/HostBlock.jsx on lines 220..223
javascript/createInterface/HostBlock.jsx on lines 224..227
javascript/createInterface/HostBlock.jsx on lines 228..231

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

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 6 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="sub-name" ref="sub_name"/></div>
                        </div>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 179..182
javascript/createInterface/HostBlock.jsx on lines 185..188
javascript/createInterface/HostBlock.jsx on lines 189..192
javascript/createInterface/HostBlock.jsx on lines 224..227
javascript/createInterface/HostBlock.jsx on lines 228..231

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

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Zip/Postal {require}</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="sub-zip" ref="sub_zip"/></div>
                        </div>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 179..182
javascript/createInterface/HostBlock.jsx on lines 185..188
javascript/createInterface/HostBlock.jsx on lines 189..192
javascript/createInterface/HostBlock.jsx on lines 220..223
javascript/createInterface/HostBlock.jsx on lines 224..227

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

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

                <div className="form-group">
                  <label className="col-lg-3 control-label">City {require}</label>
                  <div className="col-lg-9"><input  type="text" className="form-control" id="sub-city" ref="sub_city"/></div>
                </div>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 179..182
javascript/createInterface/HostBlock.jsx on lines 189..192
javascript/createInterface/HostBlock.jsx on lines 220..223
javascript/createInterface/HostBlock.jsx on lines 224..227
javascript/createInterface/HostBlock.jsx on lines 228..231

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

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

                <div className="form-group">
                  <label className="col-lg-3 control-label">Province {require}</label>
                  <div className="col-lg-9"><input  type="text" className="form-control" id="sub-province" ref="sub_province"/></div>
                </div>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 179..182
javascript/createInterface/HostBlock.jsx on lines 185..188
javascript/createInterface/HostBlock.jsx on lines 220..223
javascript/createInterface/HostBlock.jsx on lines 224..227
javascript/createInterface/HostBlock.jsx on lines 228..231

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

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

Supervisor has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class Supervisor implements DbStorable {

    public $id;
    public $host_id;
    public $supervisor_first_name;
Severity: Minor
Found in class/Supervisor.php - About 2 hrs to fix

Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var states = null;

        if (this.state.dropData != null) {
            states = this.state.dropData.map(function (data) {
Severity: Major
Found in javascript/stateList/StateList.jsx - About 2 hrs to fix

Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var dData = null;
        if (this.state.dropData != null) {
            // Maps the dropdown department data and calls the DepartmentList class
            dData = this.state.dropData.map(function (dept) {
Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx - About 2 hrs to fix

Function componentDidMount has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    componentDidMount() {

        var searchSuggestions = new Bloodhound({
            datumTokenizer: function(datum){
                var nameTokens      = Bloodhound.tokenizers.obj.whitespace('name');
Severity: Major
Found in javascript/createInterface/StudentSearch.jsx - About 2 hrs to fix

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

                        <div className="row">
                            <div className="col-md-8">
                                <div className="form-group">
                                    <input id="codeName" type="text" className="form-control" ref="addNewCode" />
                                </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 2 hrs to fix
javascript/editLevel/editLevel.jsx on lines 39..45

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

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="row">
                            <div className="col-md-8">
                                <label>Departments:</label>
                                <select className="form-control" onChange={this.handleDrop}>
                                    {dData}
Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx and 1 other location - About 2 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 416..423

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

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="row">
                            <div className="col-md-8">
                                <div className="form-group">
                                    <input id="desName" type="text" className="form-control" ref="addNewDesc" />
                                </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 2 hrs to fix
javascript/editLevel/editLevel.jsx on lines 27..33

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

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="col-md-3">
                        <div className="form-group">
                            <label>Search by Department</label>
                            <select className="form-control" onChange={this.searchListByDept}>
                                {dData}
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 1 other location - About 2 hrs to fix
javascript/facultyEdit/FacultyEdit.jsx on lines 590..597

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

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

    public static function getSupervisorById($id) {
        if(is_null($id) || !isset($id)) {
            throw new \InvalidArgumentException('Supervisor ID is required.');
        }

Severity: Major
Found in class/SupervisorFactory.php and 2 other locations - About 2 hrs to fix
class/InternshipFactory.php on lines 37..55
class/SubHostFactory.php on lines 26..43

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

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

    public static function getInternshipById($id)
    {
        if(is_null($id) || !isset($id)){
            throw new \InvalidArgumentException('Internship ID is required.');
        }
Severity: Major
Found in class/InternshipFactory.php and 2 other locations - About 2 hrs to fix
class/SubHostFactory.php on lines 26..43
class/SupervisorFactory.php on lines 26..43

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

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

    public static function getSubById($id) {
        if(is_null($id) || !isset($id)) {
            throw new \InvalidArgumentException('Host ID is required.');
        }

Severity: Major
Found in class/SubHostFactory.php and 2 other locations - About 2 hrs to fix
class/InternshipFactory.php on lines 37..55
class/SupervisorFactory.php on lines 26..43

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

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

    viewShowFilter(data, filter) {
        var filtered = [];

        for (var i = 0; i < data.length; i++) {
            var item = data[i];
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 2 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

Severity
Category
Status
Source
Language