AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Email</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="emg-email" ref="emg_email" defaultValue={this.props.email}/></div>
                        </div>
Severity: Major
Found in javascript/emergencyContact/EmgContactList.jsx and 10 other locations - About 2 hrs to fix
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 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">State</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-state" ref="host_state" defaultValue={this.props.state}/></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 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">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 208..211

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">Address</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-address" ref="host_address" defaultValue={this.props.address}/></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 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 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">Other Name</label>
                            <div className="col-lg-9"><input  type="text" className="form-control" id="host-other" ref="host_other" defaultValue={this.props.other}/></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 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

Function exports has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = (env, argv) => {
  const inProduction = argv.mode === 'production'
  const inDevelopment = argv.mode === 'development'

  const settings = {
Severity: Major
Found in webpack.config.js - About 2 hrs to fix

Function validate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    validate(form, thisComponent) {

        // Assume everything is valid, change this if we detect otherwise
        var valid = true;
        var errors = [];
Severity: Minor
Found in javascript/createInterface/CreateInternshipInterface.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

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

                <Modal.Header closeButton>
                  <Modal.Title>Edit Condition</Modal.Title>
                  {this.state.showError ? <Message type="warning" children={this.state.warningMsg}></Message> : null}
                </Modal.Header>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 90..93
javascript/createInterface/HostBlock.jsx on lines 207..210
javascript/emergencyContact/EmgContactList.jsx on lines 122..126
javascript/specialHost/ApproveHost.jsx on lines 71..74
javascript/specialHost/ApproveHost.jsx on lines 272..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 92.

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

                <Modal.Header closeButton>
                  <Modal.Title>Emergency Contact</Modal.Title>
                  {this.state.showError ? <Message type="warning" children={this.state.warningMsg}></Message> : null}

                </Modal.Header>
Severity: Major
Found in javascript/emergencyContact/EmgContactList.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 90..93
javascript/createInterface/HostBlock.jsx on lines 207..210
javascript/specialHost/ApproveHost.jsx on lines 71..74
javascript/specialHost/ApproveHost.jsx on lines 182..185
javascript/specialHost/ApproveHost.jsx on lines 272..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 92.

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

                <Modal.Header closeButton>
                  <Modal.Title>Edit Sub Host</Modal.Title>
                  {this.state.showError ? <Message type="warning" children={this.state.warningMsg}></Message> : null}
                </Modal.Header>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 90..93
javascript/createInterface/HostBlock.jsx on lines 207..210
javascript/emergencyContact/EmgContactList.jsx on lines 122..126
javascript/specialHost/ApproveHost.jsx on lines 182..185
javascript/specialHost/ApproveHost.jsx on lines 272..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 92.

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

                <Modal.Header closeButton>
                  <Modal.Title>Request Host</Modal.Title>
                  {this.state.showError ? <Message type="warning" children={this.state.warningMsg}></Message> : null}
                </Modal.Header>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 207..210
javascript/emergencyContact/EmgContactList.jsx on lines 122..126
javascript/specialHost/ApproveHost.jsx on lines 71..74
javascript/specialHost/ApproveHost.jsx on lines 182..185
javascript/specialHost/ApproveHost.jsx on lines 272..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 92.

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

                <Modal.Header closeButton>
                  <Modal.Title>Edit Host</Modal.Title>
                  {this.state.showError ? <Message type="warning" children={this.state.warningMsg}></Message> : null}
                </Modal.Header>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 90..93
javascript/createInterface/HostBlock.jsx on lines 207..210
javascript/emergencyContact/EmgContactList.jsx on lines 122..126
javascript/specialHost/ApproveHost.jsx on lines 71..74
javascript/specialHost/ApproveHost.jsx on lines 182..185

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

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

                <Modal.Header closeButton>
                  <Modal.Title>Request Sub Host</Modal.Title>
                  {this.state.showError ? <Message type="warning" children={this.state.warningMsg}></Message> : null}
                </Modal.Header>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 2 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 90..93
javascript/emergencyContact/EmgContactList.jsx on lines 122..126
javascript/specialHost/ApproveHost.jsx on lines 71..74
javascript/specialHost/ApproveHost.jsx on lines 182..185
javascript/specialHost/ApproveHost.jsx on lines 272..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 92.

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

                                    <tr>
                                        <th className="col-lg-3">Name</th>
                                        <th className="col-lg-2">Condition</th>
                                        <th className="col-lg-1">Condition Changed</th>
                                        <th className="col-lg-2">Approval</th>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 2 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 427..433

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

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

                            <select className="form-control" onChange={this.onSortByChange} value={this.state.value}>
                                <option value="-1">Select an option</option>
                                <option value="sortByAZ">Name: A-Z</option>
                                <option value="sortByZA">Name: Z-A</option>
                                <option value="SoonerToLater">Expiration Date: Sooner to Later</option>
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 1 other location - About 2 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 978..984

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

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 render has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render()
    {
        var data = null;
        var inData = null;
        if (this.state.mainData != null) {
Severity: Major
Found in javascript/editTerms/EditTerms.jsx - About 2 hrs to fix

File SaveInternship.php has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * This file is part of Internship Inventory.
 *
Severity: Minor
Found in class/Command/SaveInternship.php - About 2 hrs to fix

Method plugStudent has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function plugStudent() {
        // Student
        $this->tpl['BANNER'] = $this->intern->getBannerId();
        $this->tpl['STUDENT_FIRST_NAME'] = $this->intern->getFirstName();
        $this->tpl['STUDENT_MIDDLE_NAME'] = $this->intern->middle_name;
Severity: Major
Found in class/EditInternshipFormView.php - About 2 hrs to fix

Method moveRow has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function moveRow($order_column, $id_column, $id, $direction = 1)
    {
        if (!($direction == 1 || $direction == -1)) {
            if (strtolower($direction) == 'down') {
                $direction = 1;
Severity: Major
Found in class/SubselectDatabase.php - About 2 hrs to fix

Function get has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function get() {
        $db = \phpws2\Database::newDB();
        $pdo = $db->getPDO();
        $arr = array();

Severity: Minor
Found in class/Command/SubRest.php - 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