AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

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

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

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

    public function show(){
        // TODO: Load application in controller and pass it to HousingApplicationView constructor.
        $application = HousingApplicationFactory::getApplicationById($this->id);
        $student     = StudentFactory::getStudentByUsername($application->username, $application->term);

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

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

    public function save()
    {
        $is_new = $this->getId() == 0 ? true : false;

        # Save the core application data using the parent class
Severity: Major
Found in class/WaitingListApplication.php and 4 other locations - About 2 hrs to fix
class/FallApplication.php on lines 72..100
class/LotteryApplication.php on lines 117..145
class/SpringApplication.php on lines 68..96
class/SummerApplication.php on lines 64..92

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 138.

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 5 locations. Consider refactoring.
Open

    public function save()
    {
        $is_new = $this->getId() == 0 ? true : false;

        # Save the core application data using the parent class
Severity: Major
Found in class/SummerApplication.php and 4 other locations - About 2 hrs to fix
class/FallApplication.php on lines 72..100
class/LotteryApplication.php on lines 117..145
class/SpringApplication.php on lines 68..96
class/WaitingListApplication.php on lines 66..94

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 138.

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 5 locations. Consider refactoring.
Open

    public function save()
    {
        $is_new = $this->getId() == 0 ? true : false;

        # Save the core application data using the parent class
Severity: Major
Found in class/LotteryApplication.php and 4 other locations - About 2 hrs to fix
class/FallApplication.php on lines 72..100
class/SpringApplication.php on lines 68..96
class/SummerApplication.php on lines 64..92
class/WaitingListApplication.php on lines 66..94

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 138.

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 5 locations. Consider refactoring.
Open

    public function save()
    {
        $is_new = $this->getId() == 0 ? true : false;

        # Save the core application data using the parent class
Severity: Major
Found in class/SpringApplication.php and 4 other locations - About 2 hrs to fix
class/FallApplication.php on lines 72..100
class/LotteryApplication.php on lines 117..145
class/SummerApplication.php on lines 64..92
class/WaitingListApplication.php on lines 66..94

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 138.

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 5 locations. Consider refactoring.
Open

    public function save()
    {
        $is_new = $this->getId() == 0 ? true : false;

        # Save the core application data using the parent class
Severity: Major
Found in class/FallApplication.php and 4 other locations - About 2 hrs to fix
class/LotteryApplication.php on lines 117..145
class/SpringApplication.php on lines 68..96
class/SummerApplication.php on lines 64..92
class/WaitingListApplication.php on lines 66..94

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 138.

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

File LotteryApplication.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Homestead;

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

File SOAP.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

require_once('SOAPException.php');
require_once('BannerException.php');
require_once('StudentNotFoundException.php');
Severity: Minor
Found in contrib/SOAP.php - About 2 hrs to fix

Method execute has 70 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/GenderDistributionByHall/GenderDistributionByHall.php - About 2 hrs to fix

Method execute has 70 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/ApplicantDemographics/ApplicantDemographics.php - About 2 hrs to fix

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

  Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
    get: function () {
      if (!this.__generatedMappings) {
        this.__generatedMappings = [];
        this.__originalMappings = [];
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 1 other location - About 2 hrs to fix
javascript/react/build/JSXTransformer.js on lines 10595..10605

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 91.

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

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

    public function show()
    {
        # Get the roommate request record from the database
        $bed = new Bed($this->request['bed_id']);
        $room = $bed->get_parent();
Severity: Major
Found in class/LotteryRoommateRequestView.php - About 2 hrs to fix

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

  Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
    get: function () {
      if (!this.__originalMappings) {
        this.__generatedMappings = [];
        this.__originalMappings = [];
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 1 other location - About 2 hrs to fix
javascript/react/build/JSXTransformer.js on lines 10582..10592

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 91.

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 function clearHousingWaiver($bannerId, $term)
    {
        $params = array(
                        'User'      => $this->currentUser,
                        'BannerID'  => $bannerId,
Severity: Major
Found in contrib/SOAP.php and 1 other location - About 2 hrs to fix
contrib/SOAP.php on lines 331..351

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 137.

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 function setHousingWaiver($bannerId, $term)
    {
        $params = array(
                        'User'      => $this->currentUser,
                        'BannerID'  => $bannerId,
Severity: Major
Found in contrib/SOAP.php and 1 other location - About 2 hrs to fix
contrib/SOAP.php on lines 353..373

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 137.

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

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

    public function execute(CommandContext $context)
    {
        // Check permissions
        if (!\Current_User::allow('hms', 'checkin')) {
            throw new PermissionException('You do not have permission to checkin students.');
Severity: Major
Found in class/Command/CheckoutFormSubmitCommand.php - About 2 hrs to fix

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

    public function execute(CommandContext $context)
    {
        $docusignUsername = \PHPWS_Settings::get('hms', 'docusign_username');
        if ($docusignUsername === null || $docusignUsername == '') {
            throw new InvalidConfigurationException('Missing docusign username.');
Severity: Major
Found in class/Command/BeginDocusignCommand.php - About 2 hrs to fix

Method moveAssignments has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function moveAssignments(Array $students, $term)
    {
        // Update the assignments in Banner through the Web Service
        $soap = SOAP::getInstance(UserStatus::getUsername(), SOAP::ADMIN_USER);
        $soap->moveRoomAssignment($students, $term);
Severity: Major
Found in class/HMS_Assignment.php - About 2 hrs to fix

Function processArgs has a Cognitive Complexity of 20 (exceeds 5 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 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

Severity
Category
Status
Source
Language