AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

    constructor(props) {
        super(props);
        this.state = {
            editMode: false
        };
Severity: Major
Found in javascript/manager/Manager.jsx and 3 other locations - About 3 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 386..393
javascript/specialHost/ApproveHost.jsx on lines 432..439
javascript/specialHost/ApproveHost.jsx on lines 471..478

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

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

        return (
            <div className="form-group">
                <DepartmentDropdown onAdd={this.addDept} departments={this.state.depts} usedDepartments={this.state.usedDepts}/>
                <DepartmentList removeClick={this.removeClick} departments={this.state.usedDepts}/>
            </div>
Severity: Major
Found in javascript/affiliationAgreement/AffiliationDepartments.jsx and 1 other location - About 3 hrs to fix
javascript/affiliationAgreement/AffiliationLocation.jsx on lines 178..183

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

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

        return (
            <div className="LocationBox">
                <LocationDropdown onAdd={this.addloc} locations={this.state.locs} usedLocations={this.state.usedLocs}/>
                <LocationList removeClick={this.removeLoc} locations={this.state.usedLocs}/>
            </div>
Severity: Major
Found in javascript/affiliationAgreement/AffiliationLocation.jsx and 1 other location - About 3 hrs to fix
javascript/affiliationAgreement/AffiliationDepartments.jsx on lines 186..191

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

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

The class SaveInternship has an overall complexity of 86 which is very high. The configured complexity threshold is 50.
Open

class SaveInternship {

    public function __construct(){}

    private function rerouteWithError($url, $errorMessage)
Severity: Minor
Found in class/Command/SaveInternship.php by phpmd

The class WebServiceDataProvider has an overall complexity of 52 which is very high. The configured complexity threshold is 50.
Open

class WebServiceDataProvider extends StudentDataProvider {

    protected $currentUserName;

    private $apiKey;

The class EditInternshipFormView has an overall complexity of 70 which is very high. The configured complexity threshold is 50.
Open

class EditInternshipFormView {

    private $form;
    private $intern;
    private $student;
Severity: Minor
Found in class/EditInternshipFormView.php by phpmd

The class Internship has an overall complexity of 144 which is very high. The configured complexity threshold is 50.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Minor
Found in class/Internship.php by phpmd

The class InternshipInventory has an overall complexity of 71 which is very high. The configured complexity threshold is 50.
Open

class InternshipInventory {

    private $content;

    public function __construct()
Severity: Minor
Found in class/InternshipInventory.php by phpmd

The class SubselectDatabase has 67 public methods. Consider refactoring SubselectDatabase to keep number of public methods under 10.
Open

class SubselectDatabase extends PHPWS_DB{

    public function __construct($table = null)
    {
        parent::__construct($table);
Severity: Minor
Found in class/SubselectDatabase.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class SubselectDatabase has 67 non-getter- and setter-methods. Consider refactoring SubselectDatabase to keep number of methods under 25.
Open

class SubselectDatabase extends PHPWS_DB{

    public function __construct($table = null)
    {
        parent::__construct($table);
Severity: Minor
Found in class/SubselectDatabase.php by phpmd

TooManyMethods

Since: 0.1

A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

The class SubselectDatabase has an overall complexity of 510 which is very high. The configured complexity threshold is 50.
Open

class SubselectDatabase extends PHPWS_DB{

    public function __construct($table = null)
    {
        parent::__construct($table);
Severity: Minor
Found in class/SubselectDatabase.php by phpmd

The class SubselectPager has 22 public methods. Consider refactoring SubselectPager to keep number of public methods under 10.
Open

class SubselectPager extends \DBPager {

    public function __construct($table, $class=null)
    {
        parent::__construct($table, $class);
Severity: Minor
Found in class/SubselectPager.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class SubselectPager has an overall complexity of 250 which is very high. The configured complexity threshold is 50.
Open

class SubselectPager extends \DBPager {

    public function __construct($table, $class=null)
    {
        parent::__construct($table, $class);
Severity: Minor
Found in class/SubselectPager.php by phpmd

The class ResultsUI has an overall complexity of 76 which is very high. The configured complexity threshold is 50.
Open

class ResultsUI implements UI
{

    public function display()
    {
Severity: Minor
Found in class/UI/ResultsUI.php by phpmd

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

    render() {
        if(this.state.data === null){
            return (<div></div>);
        }

Severity: Major
Found in javascript/settings/settings.jsx - About 3 hrs to fix

Method select has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function select($type = null, $sql = null)
    {
        if (empty($sql)) {
            if (!empty($this->sql)) {
                $sql = & $this->sql;
Severity: Major
Found in class/SubselectDatabase.php - About 3 hrs to fix

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

        if (this.state.availableHost != null) {
            availHost = this.state.availableHost.map(function (available) {
            return (
                    <option key={available.id} value={available.id}>{available.host_name}</option>
                );
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 3 other locations - About 3 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 359..367
javascript/specialHost/ApproveHost.jsx on lines 345..353
javascript/specialHost/ApproveHost.jsx on lines 355..363

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

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

        if (this.state.conditionData != null) {
            conData = this.state.conditionData.map(function (condition) {
            return (
                    <option key={condition.id} value={condition.id}>{condition.admin_message}</option>
                );
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 3 other locations - About 3 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 196..204
javascript/createInterface/HostBlock.jsx on lines 359..367
javascript/specialHost/ApproveHost.jsx on lines 345..353

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

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

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

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

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

Refactorings

Further Reading

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

        if (this.state.deptData != null) {
            dData = this.state.deptData.map(function (dept) {
            return (
                    <DepartmentList key={dept.id}
                        name={dept.name}
Severity: Major
Found in javascript/editAdmin/editAdmin.jsx and 1 other location - About 3 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 370..380

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

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

        if (this.state.availableHost != null) {
            availHostOptions = this.state.availableHost.map(function (avail) {
            return (
                    <option key={avail.id} value={avail.id}>{avail.host_name}</option>
                );
Severity: Major
Found in javascript/createInterface/HostBlock.jsx and 3 other locations - About 3 hrs to fix
javascript/createInterface/HostBlock.jsx on lines 196..204
javascript/specialHost/ApproveHost.jsx on lines 345..353
javascript/specialHost/ApproveHost.jsx on lines 355..363

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language