AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

    public function execute(CommandContext $context)
    {
        if (!UserStatus::isAdmin() || !\Current_User::allow('hms', 'assignment_maintenance')) {
            throw new PermissionException('You do not have permission to assign students.');
        }
Severity: Minor
Found in class/Command/ShowAssignStudentCommand.php - About 1 hr 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 countNetAppsByClassGender has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function countNetAppsByClassGender($term, $class = null, $gender = null)
    {
        $term_year = Term::getTermYear($term);

        $query = "SELECT count(*) from hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id
Severity: Minor
Found in class/LotteryProcess.php - About 1 hr 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 applicantsReport has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function applicantsReport()
    {
        $term = Term::getSelectedTerm();

        $rlc_list = HMS_Learning_Community::getRlcList();
Severity: Minor
Found in class/HMS_RLC_Application.php - About 1 hr 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 addBed has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function addBed($roomId, $term, $bedLetter, $bedroomLabel, $phoneNumber, $bannerId, $raRoommate, $intlReserved, $raBed, $persistentId)
Severity: Major
Found in class/Bed.php - About 1 hr to fix

Function show has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        if (!UserStatus::isAdmin() || !\Current_User::allow('hms', 'bed_view')) {
            throw new PermissionException('You are not allowed to edit or view beds.');
        }
Severity: Minor
Found in class/BedView.php - About 1 hr 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 getAllFreshmenApplications has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAllFreshmenApplications($term)
    {
        $sem = Term::getTermSem($term);

        $db = new PHPWS_DB('hms_new_application');
Severity: Minor
Found in class/HousingApplication.php - About 1 hr 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 send_email has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function send_email($to, $from, $subject, $content, $cc = NULL, $bcc = NULL)
    {
        // Sanity checking
        if(!isset($to) || is_null($to)){
            return false;
Severity: Minor
Found in class/HMS_Email.php - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

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

        $tpl['TERM'] = Term::toString($this->room->getTerm());
Severity: Minor
Found in class/AddBedView.php - About 1 hr 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 __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        parent::__construct();

        // Check permissions
Severity: Minor
Found in class/RLCMenu.php - About 1 hr 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function render()
    {
      parent::render();

      $this->tpl['TERM'] = Term::toString($this->report->getTerm());
Severity: Minor
Found in class/Report/EarlyRelease/EarlyReleaseHtmlView.php - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        $halls = ResidenceHall::get_halls($this->term);

        $rows = array();
Severity: Minor
Found in class/Report/ReappAvailableBeds/ReappAvailableBeds.php - About 1 hr 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 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Buffer.prototype.toString = function toString (encoding, start, end) {
  var loweredCase = false

  start = start >>> 0
  end = end === undefined || end === Infinity ? this.length : end >>> 0
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Function parseProgramElements has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function parseProgramElements() {
        var sourceElement, sourceElements = [], token, directive, firstRestricted;

        while (index < length) {
            token = lookahead;
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Function 15 has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"amdefine":20}],15:[function(_dereq_,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Method processArgs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function processArgs($argc, $argv, &$args, &$switches)
{
    if($argc < count(array_keys($args)) + 1) {
        echo "USAGE: php {$argv[0]}";

Severity: Minor
Found in cli.php - About 1 hr to fix

Method dsn_array has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function dsn_array()
{
    static $dsn_array = null;

    if (!empty($dsn_array)) {
Severity: Minor
Found in util/createfakestudents.php - About 1 hr to fix

Method rlcApplicationPager has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function rlcApplicationPager()
    {
        $submitCmd = CommandFactory::getCommand('AssignRlcApplicants');
        $form = new \PHPWS_Form;
        $submitCmd->initForm($form);
Severity: Minor
Found in class/RlcAssignmentView.php - About 1 hr to fix

Method get_row has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function get_row($application_term)
{
    $first_name = first_name();
    $middle_name = middle_name($first_name);
    $last_name = last_name();
Severity: Minor
Found in util/createfakestudents.php - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        // Make sure we have a valid term
        $term = $context->get('term');

Severity: Minor
Found in class/Command/ShowHousingApplicationFormCommand.php - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        if(!UserStatus::isUser()) {
            throw new PermissionException('You do not have permission to request a roommate.');
        }
Severity: Minor
Found in class/Command/ShowRequestRoommateCommand.php - About 1 hr to fix
Severity
Category
Status
Source
Language