AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

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

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

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

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

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

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

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

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

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

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

    render() {

        var AffiliateData = null;
        if (this.state.mainData != null) {
            AffiliateData = this.state.displayData.map(function (affil) {
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 4 hrs to fix

Method getPageLinks has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPageLinks()
    {
        if ($this->total_pages < 1) {
            $current_page = $total_pages = 1;
        } else {
Severity: Major
Found in class/SubselectPager.php - About 4 hrs to fix

Function initFacultySelector has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

function initFacultySelector()
{
    /********************
     * Faculty Selection
     */
Severity: Minor
Found in javascript/formGoodies/otherGoodies.js - About 4 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 initialize has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in class/SubselectPager.php - About 4 hrs to fix

Method pullTables has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function pullTables($sql)
    {
        $sql = preg_replace('/ {2,}/', ' ', trim($sql));
        $sql = preg_replace('/[\n\r]/', ' ', $sql);
        $command = substr($sql, 0, strpos($sql, ' '));
Severity: Major
Found in class/SubselectDatabase.php - About 4 hrs to fix
Severity
Category
Status
Source
Language