AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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/WorkflowTransition/RegistrationIssueGrad.php and 1 other location - About 6 hrs to fix
class/WorkflowTransition/RegistrationIssueUgrad.php on lines 1..68

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

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

Method first_name has 169 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function first_name()
{
    static $first_names = array(
        'Abigail',
        'Abigail',
Severity: Major
Found in contrib/createFakeStudents.php - About 6 hrs to fix

Function initialize has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

    public function initialize($load_rows=true)
    {
        $order_set = false;
        $this->table_columns = $this->db->getTableColumns();

Severity: Minor
Found in class/SubselectPager.php - About 6 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 2 locations. Consider refactoring.
Open

                    <div className="col-md-3">
                        <label className="control-label">Filter</label> <br />
                        <div className="btn-group" data-toggle="buttons" onClick={this.onShow} value={this.state.value}>
                            <button className="btn btn-default" value="all">
                                <input  type="radio"/>All
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 6 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 949..959

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

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-2">
                            <label className="control-label">Sort By</label> <br />
                            <div className="btn-group" data-toggle="buttons" onClick={this.onSortByHostChange} value={this.state.value}>
                                <button className="btn btn-default" value="hostA">
                                    <input  type="radio"/>Host A-Z
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 6 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 1023..1033

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

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

    protected function buildMessage()
    {
        $subjects = Subject::getSubjects();

        $faculty = $this->internship->getFaculty();
Severity: Minor
Found in class/Email/ReadyToRegisterEmail.php - About 6 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

Method last_name has 155 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function last_name()
{
    static $last_names = array(
        'Acula',
        'Achenbach',
Severity: Major
Found in contrib/createFakeStudents.php - About 6 hrs to fix

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

class LocationItem extends React.Component {
    constructor(props) {
        super(props);

        this.remove = this.remove.bind(this);
Severity: Major
Found in javascript/affiliationAgreement/AffiliationLocation.jsx and 1 other location - About 6 hrs to fix
javascript/affiliationAgreement/AffiliationDepartments.jsx on lines 9..26

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

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

class DepartmentItem extends React.Component {
    constructor(props){
        super(props);

        this.remove = this.remove.bind(this);
Severity: Major
Found in javascript/affiliationAgreement/AffiliationDepartments.jsx and 1 other location - About 6 hrs to fix
javascript/affiliationAgreement/AffiliationLocation.jsx on lines 8..25

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

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 plugStudent has a Cognitive Complexity of 39 (exceeds 5 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: Minor
Found in class/EditInternshipFormView.php - About 5 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 2 locations. Consider refactoring.
Open

    constructor(props) {
      super(props);

      this.state = {locs: null, usedLocs: null};

Severity: Major
Found in javascript/affiliationAgreement/AffiliationLocation.jsx and 1 other location - About 5 hrs to fix
javascript/affiliationAgreement/AffiliationDepartments.jsx on lines 105..115

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

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

    constructor(props) {
      super(props);

      this.state = {depts: null, usedDepts: null};

Severity: Major
Found in javascript/affiliationAgreement/AffiliationDepartments.jsx and 1 other location - About 5 hrs to fix
javascript/affiliationAgreement/AffiliationLocation.jsx on lines 96..106

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

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->internship->isDistanceEd() && $this->internship->isGraduate()) {
            // Send distance ed internship to Distance Ed Office
            $this->to = explode(',', $this->emailSettings->getDistanceEdEmail());
            $this->tpl['GRADUATE'] = ''; // Dummy template var to use undergrad text
        } else if ($this->internship->isGraduate()) {
Severity: Major
Found in class/Email/ReadyToRegisterEmail.php and 1 other location - About 5 hrs to fix
class/Email/CancelInternshipNotice.php on lines 70..82

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

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->internship->isDistanceEd() && $this->internship->isGraduate()){
            $this->to = explode(',', $this->emailSettings->getDistanceEdEmail());
            $this->tpl['GRADUATE'] = ''; // Dummy template var to use undergrad text
        } else if($this->internship->isGraduate()){
            $this->to = explode(',', $this->emailSettings->getGraduateRegEmail());
Severity: Major
Found in class/Email/CancelInternshipNotice.php and 1 other location - About 5 hrs to fix
class/Email/ReadyToRegisterEmail.php on lines 161..177

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

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

    getData(){
        // Grabs the list of affiliations asc by name
        $.ajax({
            url: 'index.php?module=intern&action=AffiliateListRest&NameASC=yes',
            type: 'GET',
Severity: Major
Found in javascript/contractAffiliation/ContractAffiliation.jsx and 1 other location - About 5 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 140..155

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

    getDept() {
        //Fetch list of departments
        $.ajax({
            url: 'index.php?module=intern&action=deptRest',
            action: 'GET',
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 1 other location - About 5 hrs to fix
javascript/contractAffiliation/ContractAffiliation.jsx on lines 56..71

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

        if (this.state.dropData != null) {
            var onStateDelete = this.onStateDelete;
            row = this.state.dropData.map(function (data) {
            return (
                    <TableStates key={data.abbr}
Severity: Major
Found in javascript/stateList/StateList.jsx and 1 other location - About 5 hrs to fix
javascript/editLevel/editLevel.jsx on lines 194..208

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

Method getPager has 144 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function getPager($name = null, $deptId = null, $term = null,
            $ugradMajor = null, $gradProg = null, $level = null, $type = null,
            $campus = null, $loc = null, $state = null, $country = null,
            $workflowState = null, $courseSubject = null, $courseNum = null,
            $courseSect = null, $oied = null, $faculty = null,
Severity: Major
Found in class/UI/ResultsUI.php - About 5 hrs to fix

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

class ErrorMessagesBlock extends React.Component {
    render() {
        if(this.props.errors === null){
            return '';
        }
Severity: Major
Found in javascript/editAdmin/editAdmin.jsx and 1 other location - About 5 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 7..26

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

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