AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

Avoid excessively long variable names like $undergradOverloadHours. Keep variable name length under 20.
Open

    public function __construct(string $term, string $description, int $availableOnTimestamp, int $censusDateTimestamp, int $startTimestamp, int $endTimestamp, int $undergradOverloadHours, int $gradOverloadHours)
Severity: Minor
Found in class/Term.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $census_date_timestamp. Keep variable name length under 20.
Open

    public $census_date_timestamp;
Severity: Minor
Found in class/Term.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $undergrad_overload_hours. Keep variable name length under 20.
Open

    public $undergrad_overload_hours;
Severity: Minor
Found in class/Term.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $available_on_timestamp. Keep variable name length under 20.
Open

    public $available_on_timestamp;
Severity: Minor
Found in class/Term.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

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

                <Modal.Footer>
                    <Button onClick={this.handleSave}>Save</Button>
                    <Button onClick={this.handleExit}>Close</Button>
                </Modal.Footer>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 5 other locations - About 1 hr to fix
javascript/createInterface/HostBlock.jsx on lines 109..112
javascript/createInterface/HostBlock.jsx on lines 236..239
javascript/emergencyContact/EmgContactList.jsx on lines 156..159
javascript/specialHost/ApproveHost.jsx on lines 130..133
javascript/specialHost/ApproveHost.jsx on lines 214..217

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

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.Footer>
                    <Button onClick={this.handleSave}>Save</Button>
                    <Button onClick={this.handleExit}>Close</Button>
                </Modal.Footer>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 5 other locations - About 1 hr to fix
javascript/createInterface/HostBlock.jsx on lines 109..112
javascript/createInterface/HostBlock.jsx on lines 236..239
javascript/emergencyContact/EmgContactList.jsx on lines 156..159
javascript/specialHost/ApproveHost.jsx on lines 214..217
javascript/specialHost/ApproveHost.jsx on lines 303..306

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

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.Footer>
                    <Button onClick={this.handleSave}>Save</Button>
                    <Button onClick={this.handleExit}>Close</Button>
                </Modal.Footer>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 5 other locations - About 1 hr to fix
javascript/createInterface/HostBlock.jsx on lines 109..112
javascript/createInterface/HostBlock.jsx on lines 236..239
javascript/emergencyContact/EmgContactList.jsx on lines 156..159
javascript/specialHost/ApproveHost.jsx on lines 130..133
javascript/specialHost/ApproveHost.jsx on lines 303..306

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

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.Footer>
                    <Button onClick={this.handleSave}>Request Sub</Button>
                    <Button onClick={this.handleExit}>Close</Button>
                </Modal.Footer>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 1 hr to fix
javascript/createInterface/HostBlock.jsx on lines 109..112
javascript/emergencyContact/EmgContactList.jsx on lines 156..159
javascript/specialHost/ApproveHost.jsx on lines 130..133
javascript/specialHost/ApproveHost.jsx on lines 214..217
javascript/specialHost/ApproveHost.jsx on lines 303..306

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

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.Footer>
                    <Button onClick={this.handleSave}>Save</Button>
                    <Button onClick={this.handleExit}>Close</Button>
                </Modal.Footer>
Severity: Major
Found in javascript/emergencyContact/EmgContactList.jsx and 5 other locations - About 1 hr to fix
javascript/createInterface/HostBlock.jsx on lines 109..112
javascript/createInterface/HostBlock.jsx on lines 236..239
javascript/specialHost/ApproveHost.jsx on lines 130..133
javascript/specialHost/ApproveHost.jsx on lines 214..217
javascript/specialHost/ApproveHost.jsx on lines 303..306

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

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.Footer>
                    <Button onClick={this.handleSave}>Request Host</Button>
                    <Button onClick={this.handleExit}>Close</Button>
                </Modal.Footer>
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 5 other locations - About 1 hr to fix
javascript/createInterface/HostBlock.jsx on lines 236..239
javascript/emergencyContact/EmgContactList.jsx on lines 156..159
javascript/specialHost/ApproveHost.jsx on lines 130..133
javascript/specialHost/ApproveHost.jsx on lines 214..217
javascript/specialHost/ApproveHost.jsx on lines 303..306

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

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

    render() {
        // Create red asterisk for a required field
        var require = <span style={{color: '#FB0000'}}> *</span>;
        return (
            <Modal show={this.props.show} onHide={this.handleExit} backdrop='static'>
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 1 hr to fix

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

    render() {
        var fgClasses = classNames({'form-group': true, 'has-error': this.state.hasError});

        var availHostOptions = null;
        if (this.state.availableHost != null) {
Severity: Minor
Found in javascript/location/Location.jsx - About 1 hr to fix

Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($supervisor_first_name, $supervisor_last_name, $supervisor_title, $supervisor_phone, $supervisor_email,
                $supervisor_fax, $supervisor_address, $supervisor_city, $supervisor_state, $supervisor_zip, $supervisor_province,
                $supervisor_country, $host_id){
Severity: Major
Found in class/Supervisor.php - About 1 hr to fix

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

<?php
/**
 * This file is part of Internship Inventory.
 *
 * Internship Inventory is free software: you can redistribute it and/or modify
Severity: Major
Found in class/Command/RequestDrugScreening.php and 1 other location - About 1 hr to fix
class/Command/RequestBackgroundCheck.php on lines 1..47

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

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

<?php
/**
 * This file is part of Internship Inventory.
 *
 * Internship Inventory is free software: you can redistribute it and/or modify
Severity: Major
Found in class/Command/RequestBackgroundCheck.php and 1 other location - About 1 hr to fix
class/Command/RequestDrugScreening.php on lines 1..52

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

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

    render() {
        var fgClasses = classNames({
                        'form-group': true,
                        'has-error': this.state.hasError
                    });
Severity: Minor
Found in javascript/createInterface/StateDropDown.jsx - About 1 hr to fix

Function insert has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function insert($auto_index = true)
    {
        PHPWS_DB::touchDB();
        $maxID = true;
        $table = $this->getTable(false);
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr 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

Method plug has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function plug()
    {
    $tpl = array();
        $tpl['HOME_LINK']    = \PHPWS_Text::moduleLink('Menu', 'intern');
        $tpl['ADD_LINK']     = \PHPWS_Text::moduleLink('Add Student', 'intern', array('action' => 'ShowInternship'));
Severity: Minor
Found in class/UI/TopUI.php - About 1 hr to fix

Method post has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function post()
    {
        // Check permissions
        if(!\Current_User::isLogged()){
            header('HTTP/1.1 403 Forbidden');
Severity: Minor
Found in class/Command/EmergencyContactRest.php - About 1 hr to fix

Method contractAffilationSelected has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function contractAffilationSelected($id)
    {
        /* Check if user should have access to folders since this method does not go through execute */
        if (!\Current_User::isLogged()) {
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING,
Severity: Minor
Found in class/Command/DocumentRest.php - About 1 hr to fix
Severity
Category
Status
Source
Language