AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

    public function execute(CommandContext $context)
    {
        // Check permissions
        if(!\Current_User::allow('hms', 'special_interest_approval')){
            throw new PermissionException('You do not have permission to approve special interest group requests.');
Severity: Minor
Found in class/Command/DenySpecialInterestCommand.php - About 45 mins 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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(Student $student, $term, $startDate, $endDate, HMS_Assignment $assignment = null, RoomChangeRequest $request = null)
Severity: Minor
Found in class/RoomChangeMenuBlockView.php - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

    } else if (codePoint < 0x200000) {
      if ((units -= 4) < 0) break
      bytes.push(
        codePoint >> 0x12 | 0xF0,
        codePoint >> 0xC & 0x3F | 0x80,
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 45 mins to fix

Function execute has a Cognitive Complexity of 8 (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/FloorAssignStudentCommand.php - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                        if (source[index] === '{') {
                            ++index;
                            str += scanUnicodeCodePointEscape();
                        } else {
                            restore = index;
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        for (str += '\\u'; restore < index; ++restore) {
                            str += source[restore];
                        }
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (propName === 'constructor' && !classElement["static"]) {
                            if (specialMethod(classElement)) {
                                throwError(classElement, Messages.IllegalClassConstructorProperty);
                            }
                            if (existingProps[ClassPropertyType.prototype].has('constructor')) {
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 45 mins to fix

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

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

        $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
Severity: Minor
Found in class/Command/ReApplicationFormSubmitCommand.php - About 45 mins 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 getApplicationById has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getApplicationById($id)
    {
        $application = new HousingApplication();
        $db = new \PHPWS_DB('hms_new_application');
        $db->addWhere('id', $id);
Severity: Minor
Found in class/HousingApplicationFactory.php - About 45 mins 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 doAssignment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function doAssignment($pair)
    {

        if(is_null($this->specials)){
            return false;
Severity: Minor
Found in class/SpecialAssignmentStrategy.php - About 45 mins 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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($name, $location, $street, $city, $state, $zip)
Severity: Minor
Found in class/PackageDesk.php - About 45 mins to fix

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($integratorKey, $email, $password, $environment,
            $version = 'v2', $accountId = '')
Severity: Minor
Found in class/Docusign/Client.php - About 45 mins to fix

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($term, $startDate, $endDate, LotteryApplication $application = NULL, HMS_RLC_Application $rlcApp = NULL, HMS_RLC_Assignment $assignment = NULL){
Severity: Minor
Found in class/RlcReapplicationMenuBlockView.php - About 45 mins to fix

Function has_vacancy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function has_vacancy()
    {
        $num_assigned = $this->get_number_of_assignees();

        // If this is a private room, then this room is full if one person is assigned
Severity: Minor
Found in class/Room.php - About 45 mins 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 createEnvelopeFromTemplate has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function createEnvelopeFromTemplate(Client $client, $templateId, $emailSubject, Array $templateRoles, $status, $bannerId) {
Severity: Minor
Found in class/Docusign/EnvelopeFactory.php - About 45 mins to fix

Method sendAssignmentNotice has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function sendAssignmentNotice(Student $student, $name, $term, $location, Array $roommates, $moveinTime){
Severity: Minor
Found in class/HMS_Email.php - About 45 mins to fix

Method send_email has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function send_email($to, $from, $subject, $content, $cc = NULL, $bcc = NULL)
Severity: Minor
Found in class/HMS_Email.php - About 45 mins to fix

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($term, $startDate, $endDate, HMS_Assignment $assignment = NULL, LotteryApplication $application = NULL, $roommateRequests)
Severity: Minor
Found in class/ReapplicationMenuBlockView.php - About 45 mins to fix

Function getInstance has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstance($username, $userType)
    {
        if(!isset($username) || is_null($username)){
            throw new \InvalidArgumentException('Missing Username.');
        }
Severity: Minor
Found in class/SOAP.php - About 45 mins 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 stamp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function stamp()
    {
        // Set the last modified time
        $this->setModifiedOn(time());

Severity: Minor
Found in class/HousingApplication.php - About 45 mins 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

Severity
Category
Status
Source
Language