AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

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

    public function post() {
        $code = $_REQUEST['code'];
        $census = $_REQUEST['census'];
        $descr = $_REQUEST['descr'];
        $available = $_REQUEST['available'];
Severity: Major
Found in class/Command/TermRest.php - About 2 hrs to fix

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

    render() {
        // Create red asterisk for a required field
        var require = <span style={{color: '#FB0000'}}> *</span>;
        var loc = null;
        if(this.state.domestic === true){
Severity: Major
Found in javascript/createInterface/HostBlock.jsx - About 2 hrs to fix

Function onTermCreate has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    onTermCreate(tcode, stype, descr, census, available, start, end, ugradOver, gradOver) {

        var errorMessage = null;

        if (tcode === '' || tcode.length !== 6) {
Severity: Major
Found in javascript/editTerms/EditTerms.jsx - About 2 hrs to fix

Method getPager has 21 arguments (exceeds 4 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 2 hrs to fix

Function showWarnings has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private function showWarnings() {

        // Get state of documents or affiliation
        $conAffil = DocumentRest::contractAffilationSelected($this->intern->getId());
        // Show warning if no documents uploaded or affiliation agreement selected but workflow state suggests there should be
Severity: Minor
Found in class/InternshipView.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

Function process has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function process($arguments)
{
    $dump_data = false;

    array_shift($arguments);
Severity: Minor
Found in contrib/createFakeStudents.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 64 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/RegistrationConfirmationEmail.php - About 2 hrs to fix

Function validate has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    validate(form, thisComponent) {

        // Assume everything is valid, change this if we detect otherwise
        var valid = true;
        var errors = [];
Severity: Major
Found in javascript/createInterface/CreateInternshipInterface.jsx - About 2 hrs to fix

Method getSortButtons has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getSortButtons(&$template)
    {
        if (empty($this->table_columns)) {
            return null;
        }
Severity: Major
Found in class/SubselectPager.php - About 2 hrs to fix

Method buildMessage has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $this->subject = 'Internship Enrollment Issue';
        $this->to[] = $this->internship->email . $this->emailSettings->getEmailDomain();

Severity: Major
Found in class/Email/RegistrationIssueEmail.php - About 2 hrs to fix

File DocumentRest.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Intern\Command;

use \phpws2\Database;
Severity: Minor
Found in class/Command/DocumentRest.php - About 2 hrs to fix

AllHostList has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class AllHostList extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 2 hrs to fix

Method put has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function put() {
        $postarray = json_decode(file_get_contents('php://input'));
        $Id = $postarray->id;

        $db = Database::newDB();
Severity: Major
Found in class/Command/HostRest.php - About 2 hrs to fix

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

    render(){
        return (
            <div className="row">
                <div className="col-md-offset-1 col-md-10">

Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx - About 2 hrs to fix

Function buildMessage has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $subjects = Subject::getSubjects();
        $faculty = $this->internship->getFaculty();

Severity: Minor
Found in class/Email/RegistrationConfirmationEmail.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

Function createReport has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function createReport()
    {
        if ($this->class) {
            $methods = get_class_methods($this->class);
            if (in_array($this->report_row, $methods)) {
Severity: Minor
Found in class/SubselectPager.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 getPageRows has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

Method get has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

        if (empty($this->display_rows)) {
Severity: Major
Found in class/SubselectPager.php - About 2 hrs to fix

Supervisor has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class Supervisor implements DbStorable {

    public $id;
    public $host_id;
    public $supervisor_first_name;
Severity: Minor
Found in class/Supervisor.php - About 2 hrs to fix

Function componentDidMount has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    componentDidMount() {

        var searchSuggestions = new Bloodhound({
            datumTokenizer: function(datum){
                var nameTokens      = Bloodhound.tokenizers.obj.whitespace('name');
Severity: Major
Found in javascript/createInterface/StudentSearch.jsx - About 2 hrs to fix
Severity
Category
Status
Source
Language