AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

    public function execute(CommandContext $context)
    {
        $term = $context->get('term');

        $errorCmd = CommandFactory::getCommand('ShowHousingApplicationForm');
Severity: Minor
Found in class/Command/HousingApplicationFormSubmitCommand.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 errorFree has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    errorFree() {
        var all_clear = true;
        var errors = [];
        let resident_selected = false;

Severity: Minor
Found in javascript/CheckOut/CheckOut.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 execute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(CommandContext $context)
    {
        // Get input
        $requestId = $context->get('requestId');

Severity: Minor
Found in class/Command/RoomChangeApproveCommand.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 toString has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function toString($term, $concat = true)
    {
        $result = array();
        // Grab the year from the entry_term
        $result['year'] = Term::getTermYear($term);
Severity: Minor
Found in class/Term.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 show has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function show(){
        \Layout::addPageTitle("RLC Application Review");

        $tags = array();

Severity: Minor
Found in class/RlcApplicationReView.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 execute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        $term = $this->term;

        $sem = Term::getTermSem($term);
Severity: Minor
Found in class/Report/UnassignedStudents/UnassignedStudents.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 parseParam has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function parseParam(options) {
        var marker, token, rest, param, def;

        token = lookahead;
        if (token.value === '...') {
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

    public function execute(CommandContext $context)
    {
        if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'floor_attributes') ){
            throw new PermissionException('You do not have permission to edit floors.');
        }
Severity: Major
Found in class/Command/EditFloorCommand.php - About 2 hrs to fix

Method show has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function show()
    {
        $tpl = array();

        $tpl['TERM'] = Term::toString($this->room->getTerm());
Severity: Major
Found in class/AddBedView.php - About 2 hrs to fix

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

  public function execute()
  {
    $db = PdoFactory::getPdoInstance();

    $query = "SELECT hms_assignment.banner_id, hms_hall_structure.room_number, hms_hall_structure.hall_name
Severity: Major
Found in class/Report/RlcRoster/RlcRoster.php - About 2 hrs to fix

File HMS_Learning_Community.php has 253 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Homestead;

use \Homestead\Exception\DatabaseException;
Severity: Minor
Found in class/HMS_Learning_Community.php - About 2 hrs to fix

File RoomDamages.jsx has 252 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';

class RoomDamagesBox extends React.Component{
Severity: Minor
Found in javascript/RoomDamages/RoomDamages.jsx - About 2 hrs to fix

Function reinterpretAsCoverFormalsList has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function reinterpretAsCoverFormalsList(expressions) {
        var i, len, param, params, defaults, defaultCount, options, rest;

        params = [];
        defaults = [];
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

Function roleMan has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var roleMan = function(className, instance, div, name){
    this.div       = div;
    this.roles     = new Array();
    this.className = className;
    this.instance  = instance;
Severity: Major
Found in javascript/role_editor/editor.js - About 2 hrs to fix

Method send_emails has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function send_emails()
    {
        if(empty($_REQUEST['subject'])){
            return Notification::show_edit_email('You must fill in the subject line of the email.', '', $_REQUEST['body']);
        } else if(empty($_REQUEST['body'])){
Severity: Major
Found in class/UI/Notification.php - About 2 hrs to fix

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

     public function execute(CommandContext $context)
    {
        if (!UserStatus::isAdmin() || !\Current_User::allow('hms', 'hall_attributes') ) {
            throw new PermissionException('You do not have permission to edit halls.');
        }
Severity: Major
Found in class/Command/EditResidenceHallCommand.php - About 2 hrs to fix

Method show has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function show()
    {
        $tpl = array();

        $roommate = HMS_Roommate::get_confirmed_roommate(UserStatus::getUsername(), $this->term);
Severity: Major
Found in class/RoommateSelectionMenuBlockView.php - About 2 hrs to fix

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

    public function execute()
    {
        $db = PdoFactory::getPdoInstance();

        $query = 'SELECT hms_new_application.username, hms_new_application.banner_id, hms_lottery_application.early_release FROM hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id WHERE (hms_new_application.term = :term AND hms_lottery_application.early_release IS NOT NULL) ORDER BY hms_lottery_application.early_release ASC, hms_new_application.username ASC';
Severity: Major
Found in class/Report/EarlyRelease/EarlyRelease.php - About 2 hrs to fix

Function parseSourceElement has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function parseSourceElement() {
        var token;
        if (lookahead.type === Token.Keyword) {
            switch (lookahead.value) {
            case 'const':
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

    public function execute(CommandContext $context){

        if(!\Current_User::allow('hms', 'learning_community_maintenance')) {
            throw new PermissionException('You do not have permission to edit learning communities.');
        }
Severity: Minor
Found in class/Command/SaveRlcCommand.php - About 2 hrs to fix
Severity
Category
Status
Source
Language