AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

File AffiliateList.jsx has 402 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import {CSSTransition} from 'react-transition-group'
import classNames from 'classnames';
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 5 hrs to fix

Function initFacultySelector has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function initFacultySelector()
{
    /********************
     * Faculty Selection
     */
Severity: Major
Found in javascript/formGoodies/otherGoodies.js - About 5 hrs to fix

Method intern_update has 135 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function intern_update(&$content, $currentVersion)
{
    PHPWS_Core::initModClass('users', 'Permission.php');

    switch ($currentVersion) {
Severity: Major
Found in boost/update.php - About 5 hrs to fix

Method generatePdf has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function generatePdf()
    {
        $this->pdf = new \setasign\Fpdi\Fpdi('P', 'mm', 'Letter');
        $h = $this->internship->getHost();
        $s = $this->internship->getSupervisor();
Severity: Major
Found in class/InternshipContractPdfView.php - About 5 hrs to fix

File HostBlock.jsx has 383 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import classNames from 'classnames';
import {Button, Modal} from 'react-bootstrap';
import LocationBlock from './LocationBlock.jsx';
import Message from '../emergencyContact/Message.jsx';
Severity: Minor
Found in javascript/createInterface/HostBlock.jsx - About 5 hrs to fix

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

        if(strlen($super_address) < 65){
            // If it's short enough, just write it
            $this->pdf->setXY(113, 149);
            $this->pdf->cell(78, 5, $super_address);
        }else{
Severity: Major
Found in class/InternshipContractPdfView.php and 2 other locations - About 5 hrs to fix
class/InternshipContractPdfView.php on lines 157..171
class/InternshipContractPdfView.php 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 186.

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

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

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

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

Refactorings

Further Reading

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

            if(strlen($fullAddress) < 51){
                // If it's short enough, just write it
                $this->pdf->setXY(31, 127);
                $this->pdf->cell(81, 5, $fullAddress);
            }else{
Severity: Major
Found in class/InternshipContractPdfView.php and 2 other locations - About 5 hrs to fix
class/InternshipContractPdfView.php on lines 194..208
class/InternshipContractPdfView.php on lines 233..247

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

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

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

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

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

Refactorings

Further Reading

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

        if(strlen($host_address) < 51){
            // If it's short enough, just write it
            $this->pdf->setXY(127, 128);
            $this->pdf->cell(77, 5, $host_address);
        }else{
Severity: Major
Found in class/InternshipContractPdfView.php and 2 other locations - About 5 hrs to fix
class/InternshipContractPdfView.php on lines 157..171
class/InternshipContractPdfView.php on lines 233..247

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

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

    public function get($return_blank_results=true)
    {
        $template = array();

        if (empty($this->display_rows)) {
Severity: Minor
Found in class/SubselectPager.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

                        <div className="form-group">
                            <label className="col-lg-3 control-label">Approve {require}</label>
                                <select className="form-control col-lg-7 select-sub-host" id="host-flag" ref="flag" defaultValue={this.props.flag}>
                                    <option value="0">Not Approved</option>
                                    <option value="1">Approved</option>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 5 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 120..127

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

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="form-group">
                            <label className="col-lg-3 control-label">Approve {require}</label>
                                <select className="form-control col-lg-7 select-sub-host" id="host-flag" ref="host_flag" defaultValue={this.props.flag}>
                                    <option value="0">Not Approved</option>
                                    <option value="1">Approved</option>
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 1 other location - About 5 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 289..296

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

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

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

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

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

Refactorings

Further Reading

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

    getHostConData(){
        $.ajax({
            url: 'index.php?module=intern&action=HostRest&Condition=true',
            type: 'GET',
            dataType: 'json',
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 2 other locations - About 4 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 125..139
javascript/specialHost/ApproveHost.jsx on lines 599..612

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

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

        $.ajax({
            url: 'index.php?module=intern&action=agreementType&affilId='+choose+'&internId='+ this.props.internshipId,
            type:'PUT',
            success: function() {
                this.setState({selected: choose});
Severity: Major
Found in javascript/contractAffiliation/ContractAffiliation.jsx and 1 other location - About 4 hrs to fix
javascript/contractAffiliation/ContractAffiliation.jsx on lines 240..250

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

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

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

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

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

Refactorings

Further Reading

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

    getMainData(){
        $.ajax({
            url: 'index.php?module=intern&action=SubRest',
            type: 'GET',
            dataType: 'json',
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx and 2 other locations - About 4 hrs to fix
javascript/affiliationAgreement/AffiliateList.jsx on lines 125..139
javascript/specialHost/ApproveHost.jsx on lines 613..626

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

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.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/location/Location.jsx and 1 other location - About 4 hrs to fix
javascript/location/Location.jsx on lines 102..110

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

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

        $.ajax({
            url: 'index.php?module=intern&action=agreementType&agreeType='+ type +'&internId='+ this.props.internshipId,
            type: 'PUT',
            success: function() {
                this.setState({agreementType: type});
Severity: Major
Found in javascript/contractAffiliation/ContractAffiliation.jsx and 1 other location - About 4 hrs to fix
javascript/contractAffiliation/ContractAffiliation.jsx on lines 44..54

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

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

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

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

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

Refactorings

Further Reading

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

    getData() {
        $.ajax({
            url: 'index.php?module=intern&action=AffiliateListRest',
            type: 'GET',
            dataType: 'json',
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx and 2 other locations - About 4 hrs to fix
javascript/specialHost/ApproveHost.jsx on lines 599..612
javascript/specialHost/ApproveHost.jsx on lines 613..626

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

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.availableSub != null) {
            locationDropDown = this.state.availableSub.map(function (availS) {
                return (
                    <option key={availS.id} value={availS.id}>{availS.sub_name}</option>
                );
Severity: Major
Found in javascript/location/Location.jsx and 1 other location - About 4 hrs to fix
javascript/location/Location.jsx on lines 91..99

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

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

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

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

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

Refactorings

Further Reading

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

    public function checkRequiredFields(Internship $i){
        if (!$i->isSecondaryPart()) {
            // Check the course subject
            $courseSubj = $i->getSubject();
            if (!isset($courseSubj) || $courseSubj == '' || $courseSubj->id == 0){
Severity: Major
Found in class/WorkflowTransition/GraduateRegistration.php and 1 other location - About 4 hrs to fix
class/WorkflowTransition/RegisterAfterIssue.php on lines 58..85

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

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