AppStateESS/InternshipInventory

View on GitHub
javascript/editLevel/editLevel.jsx

Summary

Maintainability
F
4 days
Test Coverage

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

    render() {
        return (
            <div className="col-md-5 col-md-offset-1">
                <br /><br /><br />
                <div className="panel panel-default">
Severity: Minor
Found in javascript/editLevel/editLevel.jsx - About 2 hrs to fix

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

    render() {
        var data = null;
        if (this.state.mainData != null) {
            var onSave = this.onSave;
            data = this.state.mainData.map(function (data) {
Severity: Minor
Found in javascript/editLevel/editLevel.jsx - About 1 hr to fix

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

    render() {
        var textDes = null;
        var textLev = null;
        var eButton = null;
        var textName = <span className="text-muted"> {this.props.code} </span>;
Severity: Minor
Found in javascript/editLevel/editLevel.jsx - About 1 hr to fix

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

        if (this.state.mainData != null) {
            var onSave = this.onSave;
            data = this.state.mainData.map(function (data) {
                return (
                    <DisplayData key={data.code}
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 5 hrs to fix
javascript/stateList/StateList.jsx on lines 165..178

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

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

    getData(){
        $.ajax({
            url: 'index.php?module=intern&action=levelRest',
            type: 'GET',
            dataType: 'json',
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 2 other locations - About 4 hrs to fix
javascript/editCourses/courseEditor.jsx on lines 171..184
javascript/editTerms/EditTerms.jsx on lines 406..419

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

                <div id="success" className="alert alert-success alert-dismissible" role="alert" hidden>
                    <button type="button"  className="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <strong>Success!</strong> {this.state.success}
                </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 4 other locations - About 3 hrs to fix
javascript/editLevel/editLevel.jsx on lines 218..221
javascript/facultyEdit/FacultyEdit.jsx on lines 582..585
javascript/manager/Manager.jsx on lines 245..248
javascript/manager/Manager.jsx on lines 250..253

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

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

                <div id="warningError" className="alert alert-warning alert-dismissible" role="alert" hidden>
                    <button type="button"  className="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <strong>Warning!</strong> {this.state.errorWarning}
                </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 4 other locations - About 3 hrs to fix
javascript/editLevel/editLevel.jsx on lines 213..216
javascript/facultyEdit/FacultyEdit.jsx on lines 582..585
javascript/manager/Manager.jsx on lines 245..248
javascript/manager/Manager.jsx on lines 250..253

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

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="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">
                                <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

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

            error: function(http) {
                var errorMessage = http.responseText;
                this.setState({errorWarning: errorMessage});
                $("#warningError").show();
                $("#success").hide();
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 2 hrs to fix
javascript/editLevel/editLevel.jsx on lines 163..168

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

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

            error: function(http) {
                var errorMessage = http.responseText;
                this.setState({errorWarning: errorMessage});
                $("#warningError").show();
                $("#success").hide();
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 2 hrs to fix
javascript/editLevel/editLevel.jsx on lines 184..189

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

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

            textDes = <div id={this.props.description} >
                <input type="text" className="form-control" defaultValue={this.props.description} ref="savedDesData" />
            </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 1 hr to fix
javascript/editLevel/editLevel.jsx on lines 103..105

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

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

            textLev = <div id={this.props.level} >
                <input type="text" className="form-control" defaultValue={this.props.level} ref="savedLevelData" />
            </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 1 hr to fix
javascript/editLevel/editLevel.jsx on lines 100..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 71.

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-4">
                                <div className="form-group">
                                    <button className="btn btn-default btn-md" onClick={this.handleClick}>Create Code</button>
                                </div>
                            </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 1 other location - About 1 hr to fix
javascript/editAdmin/editAdmin.jsx on lines 311..315

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

                        <div className="row">
                            <div className="col-md-10">
                                <label>Code:</label>
                            </div>
                        </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 7 other locations - About 40 mins to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 398..402
javascript/editLevel/editLevel.jsx on lines 34..38
javascript/editLevel/editLevel.jsx on lines 46..50
javascript/specialHost/ApproveHost.jsx on lines 905..909
javascript/specialHost/ApproveHost.jsx on lines 914..918
javascript/specialHost/ApproveHost.jsx on lines 937..941
javascript/specialHost/ApproveHost.jsx on lines 994..998

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

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="row">
                            <div className="col-md-10">
                                <label>Level:</label>
                            </div>
                        </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 7 other locations - About 40 mins to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 398..402
javascript/editLevel/editLevel.jsx on lines 22..26
javascript/editLevel/editLevel.jsx on lines 34..38
javascript/specialHost/ApproveHost.jsx on lines 905..909
javascript/specialHost/ApproveHost.jsx on lines 914..918
javascript/specialHost/ApproveHost.jsx on lines 937..941
javascript/specialHost/ApproveHost.jsx on lines 994..998

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

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="row">
                            <div className="col-md-10">
                                <label>Description:</label>
                            </div>
                        </div>
Severity: Major
Found in javascript/editLevel/editLevel.jsx and 7 other locations - About 40 mins to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 398..402
javascript/editLevel/editLevel.jsx on lines 22..26
javascript/editLevel/editLevel.jsx on lines 46..50
javascript/specialHost/ApproveHost.jsx on lines 905..909
javascript/specialHost/ApproveHost.jsx on lines 914..918
javascript/specialHost/ApproveHost.jsx on lines 937..941
javascript/specialHost/ApproveHost.jsx on lines 994..998

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

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

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

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

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

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status