AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

File EditTerms.jsx has 554 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import Calendar from 'react-calendar';
import 'react-calendar/dist/Calendar.css';
Severity: Major
Found in javascript/editTerms/EditTerms.jsx - About 1 day to fix

Function getPageRows has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPageRows()
    {
        $template = null;
        $count = 0;

Severity: Minor
Found in class/SubselectPager.php - About 1 day 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

Function buildInternshipForm has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildInternshipForm() {
        javascript('jquery');
        javascript('jquery_ui');

        // Form Submission setup, only allowed to save if you have permission
Severity: Minor
Found in class/EditInternshipFormView.php - About 1 day 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

Function addWhere has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    public function addWhere($column, $value = null, $operator = null, $conj = null, $group = null, $join = false)
    {
        PHPWS_DB::touchDB();

        $where = new PHPWS_DB_Where;
Severity: Minor
Found in class/SubselectDatabase.php - About 1 day 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 buildInternshipForm has 226 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildInternshipForm() {
        javascript('jquery');
        javascript('jquery_ui');

        // Form Submission setup, only allowed to save if you have permission
Severity: Major
Found in class/EditInternshipFormView.php - About 1 day to fix

Function getColumn has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

    public function getColumn($format = false)
    {
        if ($format) {
            if (empty($this->columns)) {
                //return $this->tables[0] . '.*';
Severity: Minor
Found in class/SubselectDatabase.php - About 1 day 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

Function getPager has a Cognitive Complexity of 55 (exceeds 5 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: Minor
Found in class/UI/ResultsUI.php - About 1 day 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

File FacultyEdit.jsx has 515 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import '../custom.css'
import {Button, Modal} from 'react-bootstrap';
Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx - About 1 day to fix

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

        var selectOptions = options.map(function(location){

            // Check if this location is in the set of used locations
            var usedIndex = this.props.usedLocations.findIndex(function(element, index, arr){
                if(location.abbr === element.abbr){
Severity: Major
Found in javascript/affiliationAgreement/AffiliationLocation.jsx and 1 other location - About 1 day to fix
javascript/affiliationAgreement/AffiliationDepartments.jsx on lines 67..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 199.

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

        var selectOptions = options.map(function(department){

            // Check if this department is in the set of used departments
            var usedIndex = this.props.usedDepartments.findIndex(function(element, index, arr){
                if(department.id === element.id){
Severity: Major
Found in javascript/affiliationAgreement/AffiliationDepartments.jsx and 1 other location - About 1 day to fix
javascript/affiliationAgreement/AffiliationLocation.jsx on lines 58..76

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

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

    render() {
        var ApproveData = null;
        if (this.state.approveData != null && this.state.hostData != null && this.state.conditionData != null) {
            ApproveData = this.state.approveData.map(function (host) {
                return (
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx - About 1 day to fix

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

    componentDidMount() {
        // Fetch list of available undergrad majors
        $.ajax({
            url: 'index.php?module=intern&action=GetUndergradMajors',
            dataType: 'json',
Severity: Major
Found in javascript/majorSelector/MajorSelector.jsx and 1 other location - About 7 hrs to fix
javascript/searchInterface/SearchInterface.jsx on lines 26..50

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

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

    componentDidMount() {
        // Fetch list of available states
        $.ajax({
            url: 'index.php?module=intern&action=GetStates',
            dataType: 'json',
Severity: Major
Found in javascript/searchInterface/SearchInterface.jsx and 1 other location - About 7 hrs to fix
javascript/majorSelector/MajorSelector.jsx on lines 23..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 194.

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

SubselectPager has 55 functions (exceeds 20 allowed). Consider refactoring.
Open

class SubselectPager extends \DBPager {

    public function __construct($table, $class=null)
    {
        parent::__construct($table, $class);
Severity: Major
Found in class/SubselectPager.php - About 7 hrs to fix

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

                    <div className="row">
                        <div className="col-md-6">
                            <label htmlFor="faculty-edit-first_name">First Name</label>
                            <input type="text" className="form-control" id="faculty-edit-first_name" ref="facultyEditFirstName" defaultValue={this.props.facultyData.first_name} />
                        </div>
Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx and 1 other location - About 7 hrs to fix
javascript/facultyEdit/FacultyEdit.jsx on lines 107..116

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

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="row">
                        <div className="col-md-6">
                            <label htmlFor="faculty-edit-phone">Phone</label>
                            <input type="text" className="form-control" id="faculty-edit-phone" ref="facultyEditPhone" defaultValue={this.props.facultyData.phone} />
                        </div>
Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx and 1 other location - About 7 hrs to fix
javascript/facultyEdit/FacultyEdit.jsx on lines 96..105

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

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

function processArgs($argc, $argv, &$args, &$switches)
{
    if($argc < count(array_keys($args)) + 1) {
        echo "USAGE: php {$argv[0]}";

Severity: Major
Found in cli.php and 1 other location - About 7 hrs to fix
contrib/cliCommon.php on lines 26..60

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

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

function check_args($argc, $argv, &$args, &$switches)
{
    if($argc < count(array_keys($args)) + 1) {
        echo "USAGE: php {$argv[0]}";

Severity: Major
Found in contrib/cliCommon.php and 1 other location - About 7 hrs to fix
cli.php on lines 59..93

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

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 EditInternshipFormView.php has 459 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * This file is part of Internship Inventory.
 *
 * Internship Inventory is free software: you can redistribute it and/or modify
Severity: Minor
Found in class/EditInternshipFormView.php - About 7 hrs 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/WorkflowTransition/RegistrationIssueUgrad.php and 1 other location - About 6 hrs to fix
class/WorkflowTransition/RegistrationIssueGrad.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

Severity
Category
Status
Source
Language