AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Function select has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function select($type = null, $sql = null)
    {
        if (empty($sql)) {
            if (!empty($this->sql)) {
                $sql = & $this->sql;
Severity: Minor
Found in class/SubselectDatabase.php - About 3 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 moveRow has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function moveRow($order_column, $id_column, $id, $direction = 1)
    {
        if (!($direction == 1 || $direction == -1)) {
            if (strtolower($direction) == 'down') {
                $direction = 1;
Severity: Minor
Found in class/SubselectDatabase.php - About 3 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 pullTables has a Cognitive Complexity of 23 (exceeds 5 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: Minor
Found in class/SubselectDatabase.php - About 3 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

Faculty has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

class Faculty extends Model implements DbStorable {

    public $id;
    private $username;

Severity: Minor
Found in class/Faculty.php - About 3 hrs to fix

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

    render() {
        var conData = null;
        if (this.props.conditionData != null) {
            conData = this.props.conditionData.map(function (condition) {
            return (
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx - About 3 hrs to fix

Function _getJoinOn has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _getJoinOn($join_on_1, $join_on_2, $table1, $table2, $ignore_tables = false)
    {
        if (empty($join_on_1) || empty($join_on_2)) {
            return null;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 3 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 saveObject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveObject($object, $stripChar = false, $autodetect_id = true)
    {
        if (!is_object($object)) {
            return PHPWS_Error::get(PHPWS_WRONG_TYPE, 'core', 'PHPWS_DB::saveObject', _('Type') . ': ' . gettype($object));
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 3 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

File editAdmin.jsx has 295 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'

Severity: Minor
Found in javascript/editAdmin/editAdmin.jsx - About 3 hrs to fix

File EmgContactList.jsx has 293 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 './Message.jsx';
Severity: Minor
Found in javascript/emergencyContact/EmgContactList.jsx - About 3 hrs to fix

File ContractAffiliation.jsx has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import Dropzone from 'react-dropzone';
import $ from 'jquery';
import classNames from 'classnames';
Severity: Minor
Found in javascript/contractAffiliation/ContractAffiliation.jsx - About 3 hrs to fix

File InternshipInventory.php has 290 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/InternshipInventory.php - About 2 hrs to fix

Function exports has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = (env, argv) => {
  const inProduction = argv.mode === 'production'
  const inDevelopment = argv.mode === 'development'

  const settings = {
Severity: Major
Found in webpack.config.js - About 2 hrs to fix

Function validate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    validate(form, thisComponent) {

        // Assume everything is valid, change this if we detect otherwise
        var valid = true;
        var errors = [];
Severity: Minor
Found in javascript/createInterface/CreateInternshipInterface.jsx - About 2 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 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render()
    {
        var data = null;
        var inData = null;
        if (this.state.mainData != null) {
Severity: Major
Found in javascript/editTerms/EditTerms.jsx - About 2 hrs to fix

File SaveInternship.php has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * This file is part of Internship Inventory.
 *
Severity: Minor
Found in class/Command/SaveInternship.php - About 2 hrs to fix

Method plugStudent has 69 lines of code (exceeds 25 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: Major
Found in class/EditInternshipFormView.php - About 2 hrs to fix

Method moveRow has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function moveRow($order_column, $id_column, $id, $direction = 1)
    {
        if (!($direction == 1 || $direction == -1)) {
            if (strtolower($direction) == 'down') {
                $direction = 1;
Severity: Major
Found in class/SubselectDatabase.php - About 2 hrs to fix

Function get has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function get() {
        $db = \phpws2\Database::newDB();
        $pdo = $db->getPDO();
        $arr = array();

Severity: Minor
Found in class/Command/SubRest.php - About 2 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 buildMessage has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

        $faculty = $this->internship->getFaculty();
Severity: Major
Found in class/Email/GradSchoolNotificationEmail.php - About 2 hrs to fix

Method display has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function display()
    {

        \javascript('jquery');
        \javascript('jquery_ui');
Severity: Major
Found in class/UI/SearchUI.php - About 2 hrs to fix
Severity
Category
Status
Source
Language