AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

File SubselectDatabase.php has 1892 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: Major
Found in class/SubselectDatabase.php - About 5 days to fix

File ApproveHost.jsx has 993 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import {Button, Modal} from 'react-bootstrap';
import Message from '../emergencyContact/Message.jsx';
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx - About 2 days to fix

File SubselectPager.php has 982 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: Major
Found in class/SubselectPager.php - About 2 days to fix

File createFakeStudents.php has 892 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/php
<?php
/**
 * This file is part of Internship Inventory.
 *
Severity: Major
Found in contrib/createFakeStudents.php - About 2 days to fix

SubselectDatabase has 105 functions (exceeds 20 allowed). Consider refactoring.
Open

class SubselectDatabase extends PHPWS_DB{

    public function __construct($table = null)
    {
        parent::__construct($table);
Severity: Major
Found in class/SubselectDatabase.php - About 2 days to fix

Internship has 87 functions (exceeds 20 allowed). Consider refactoring.
Open

class Internship {

    const GPA_MINIMUM = 2.00;

    public $id;
Severity: Major
Found in class/Internship.php - About 1 day to fix

Function execute has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute() {
        // We don't want to do certain things like state change or error checks if this is an ajax request.
        $isAjax = false;
        if(\Canopy\Request::isAjax()){
            $isAjax = true;
Severity: Minor
Found in class/Command/SaveInternship.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 Internship.php has 624 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: Major
Found in class/Internship.php - About 1 day to fix

Method handleRequest has 274 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handleRequest()
    {
        // Check if it is time to add more term. If so, show a warning to admins.
        $futureTerms = TermFactory::getFutureTermsAssoc();
        if(sizeof($futureTerms) < 3 && \Current_User::isDeity()){
Severity: Major
Found in class/InternshipInventory.php - About 1 day to fix

Function handleRequest has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

    public function handleRequest()
    {
        // Check if it is time to add more term. If so, show a warning to admins.
        $futureTerms = TermFactory::getFutureTermsAssoc();
        if(sizeof($futureTerms) < 3 && \Current_User::isDeity()){
Severity: Minor
Found in class/InternshipInventory.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 getPageLinks has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPageLinks()
    {
        if ($this->total_pages < 1) {
            $current_page = $total_pages = 1;
        } else {
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

Method execute has 241 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute() {
        // We don't want to do certain things like state change or error checks if this is an ajax request.
        $isAjax = false;
        if(\Canopy\Request::isAjax()){
            $isAjax = true;
Severity: Major
Found in class/Command/SaveInternship.php - About 1 day to fix

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

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

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
Severity
Category
Status
Source
Language