AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

    public function show()
    {
        \PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');

        $hall = new ResidenceHall($this->hallId);
Severity: Minor
Found in class/LotteryChooseFloorView.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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(CommandContext $context)
    {
        // Get input
        $requestId = $context->get('requestId');
        $participantId = $context->get('participantId');
Severity: Minor
Found in class/Command/RoomChangeCurrRdApproveCommand.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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        \PHPWS_Core::initCoreClass('Form.php');

        if (!UserStatus::isAdmin() || !\Current_User::allow('hms', 'assignment_maintenance')) {
Severity: Minor
Found in class/AssignStudentView.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 copy has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function copy($to_term, $floor_id, $suite_id=NULL, $assignments = false)
    {
        if (!$this->id) {
            return false;
        }
Severity: Minor
Found in class/Room.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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        $checkin = CheckinFactory::getCheckinByBannerId($this->student->getBannerId(), $this->term);

        // If there's no fall checkin, check for a checkin in the following Spring term (could be that we're looking a student menu for Fall that shows both fall-spring assignments)
Severity: Minor
Found in class/DamageMenuBlockView.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 unassignStudent has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function unassignStudent(Student $student, $term, $notes = "", $reason, $refund)
    {
        if (!UserStatus::isAdmin() || !\Current_User::allow('hms', 'assignment_maintenance')) {
            throw new PermissionException('You do not have permission to unassign students.');
        }
Severity: Minor
Found in class/HMS_Assignment.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 doPairing has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function doPairing(&$applications, &$pairs)
    {
        $db = new \PHPWS_DB('hms_roommate');
        $db->addWhere('term', $this->term);
        $db->addWhere('confirmed', 1);
Severity: Minor
Found in class/RequestedRoommatePairingStrategy.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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        if (!isset($this->term) || is_null($this->term)) {
            throw new \InvalidArgumentException('Missing term.');
        }
Severity: Minor
Found in class/Report/MoveInTimes/MoveInTimes.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 render has a Cognitive Complexity of 17 (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/UnavailableBeds/UnavailableBedsHtmlView.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 17 (exceeds 5 allowed). Consider refactoring.
Open

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

        // Show availability dates!
Severity: Minor
Found in class/ApplicationMenuBlockView.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 reportSetupDialog has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.fn.reportSetupDialog = function(settings) {
    settings = jQuery.extend({
        dialogId: null,
        linkId: null,
        reportName: null,
Severity: Major
Found in javascript/reportSetupDialog/reportSetupDialog.js - About 2 hrs to fix

Function loadScripts has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function loadScripts(scripts) {
  var result = [];
  var count = scripts.length;

  function check() {
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

Function 30 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"../src/utils":23,"esprima-fb":9}],30:[function(_dereq_,module,exports){
/**
 * Copyright 2013 Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

    public function execute()
    {
        if (!isset($this->term) || is_null($this->term)) {
            throw new \InvalidArgumentException('Missing term.');
        }
Severity: Major
Found in class/Report/TwentyOne/TwentyOne.php - About 2 hrs to fix

File defines.php has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

// This file contains the testing defines.  It has been moved out of defines.php
// due to the obvious issue of what to do every time prod is exported.  This
// file is in subversion is inc/hms_defines.php, and should live in phpWebSite's
Severity: Minor
Found in inc/defines.php - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public static function cliExec()
    {
        \PHPWS_Core::initModClass('users', 'Users.php');
        \PHPWS_Core::initModClass('users', 'Current_User.php');

Severity: Major
Found in class/Scheduled/UpdateDocusignContractStatus.php and 1 other location - About 2 hrs to fix
class/Scheduled/UpdateMandrillInfo.php on lines 9..31

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 126.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  public static function cliExec()
  {
      \PHPWS_Core::initModClass('users', 'Users.php');
      \PHPWS_Core::initModClass('users', 'Current_User.php');

Severity: Major
Found in class/Scheduled/UpdateMandrillInfo.php and 1 other location - About 2 hrs to fix
class/Scheduled/UpdateDocusignContractStatus.php on lines 15..37

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 126.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php

namespace Homestead;

class CoedAssignmentStrategy extends AssignmentStrategy
Severity: Major
Found in class/CoedAssignmentStrategy.php and 1 other location - About 2 hrs to fix
class/SingleGenderAssignmentStrategy.php on lines 1..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 126.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php

namespace Homestead;

class SingleGenderAssignmentStrategy extends Assignmentstrategy
Severity: Major
Found in class/SingleGenderAssignmentStrategy.php and 1 other location - About 2 hrs to fix
class/CoedAssignmentStrategy.php on lines 1..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 126.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function _augment has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Buffer._augment = function _augment (arr) {
  arr.constructor = Buffer
  arr._isBuffer = true

  // save reference to original Uint8Array get/set methods before overwriting
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix
Severity
Category
Status
Source
Language