AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

    public function execute(CommandContext $context){

        $term = Term::getCurrentTerm();

        // Get the list of role memberships this user has
Severity: Minor
Found in class/Command/ShowRDRoomChangeListCommand.php - About 1 hr to fix

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

    public function execute(CommandContext $context){
        $errorCmd = CommandFactory::getCommand('ShowStudentMenu');

        $term = $context->get('term');
        $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
Severity: Minor
Found in class/Command/ShowRlcReapplicationCommand.php - About 1 hr to fix

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

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

        $errorCmd = CommandFactory::getCommand('ShowOffCampusWaitListApplication');
Severity: Minor
Found in class/Command/OffCampusWaitingListFormSaveCommand.php - About 1 hr to fix

Method copy has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function copy($to_term, $room_id, $assignments)
    {
        if (!$this->id) {
            return false;
        }
Severity: Minor
Found in class/Bed.php - About 1 hr to fix

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

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

        $sql = "SELECT

Consider simplifying this complex logical expression.
Open

  if (object &&
      object.type === Syntax.CallExpression &&
      object.callee.type === Syntax.MemberExpression &&
      object.callee.object.type === Syntax.Identifier &&
      object.callee.object.name === 'React' &&
Severity: Critical
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

            if(($room->gender_type != $this->student->getGender() && $room->gender_type != AUTO)
                || $num_avail_beds     == 0
                || $room->reserved == 1
                || $room->offline  == 1
                || $room->private  == 1
Severity: Critical
Found in class/LotteryChooseRoomView.php - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        if ($result['rlc_first_choice_id']  == $resultb['rlc_first_choice_id'] ||
        $result['rlc_first_choice_id']  == $resultb['rlc_second_choice_id'] ||
        $result['rlc_first_choice_id']  == $resultb['rlc_third_choice_id'] ||
        $result['rlc_second_choice_id'] == $resultb['rlc_first_choice_id'] ||
        $result['rlc_second_choice_id'] == $resultb['rlc_second_choice_id'] ||
Severity: Critical
Found in class/HMS_Roommate.php - About 1 hr to fix

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

    public function unassignedStudentsFields()
    {
        $fields = parent::unassignedStudentsFields();

        $fields['lifestyle']            = $this->getLifestyleOption()   == 1 ? 'Single gender' : 'Co-ed';
Severity: Major
Found in class/SpringApplication.php and 1 other location - About 1 hr to fix
class/FallApplication.php on lines 123..132

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

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

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

    public function unassignedStudentsFields()
    {
        $fields = parent::unassignedStudentsFields();

        $fields['lifestyle']            = $this->getLifestyleOption()   == 1 ? 'Single gender' : 'Co-ed';
Severity: Major
Found in class/FallApplication.php and 1 other location - About 1 hr to fix
class/SpringApplication.php on lines 119..129

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

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 processComment has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function processComment(node) {
        var lastChild,
            trailingComments,
            bottomRight = extra.bottomRightStack,
            last = bottomRight[bottomRight.length - 1];
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Function parseObjectInitialiser has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function parseObjectInitialiser() {
        var properties = [], property, name, kind, storedKind, map = new StringMap(),
            marker = markerCreate(), toString = String;

        expect('{');
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Method execute has 41 lines of code (exceeds 25 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 1 hr to fix

Method show has 41 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: Minor
Found in class/LotteryConfirmRoommateRequestView.php - About 1 hr to fix

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

    public static function execute()
    {
        session_start();
        \PHPWS_Core::initModClass('users', 'Users.php');
        \PHPWS_Core::initModClass('users', 'Current_User.php');
Severity: Minor
Found in class/NightlyCache.php - About 1 hr to fix

Method copy has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function copy($to_term, $hall_id, $assignments = false, $roles = false)
    {
        if(!$this->id) {
            return false;
        }
Severity: Minor
Found in class/Floor.php - About 1 hr to fix

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

    public function __construct($id = 0, $term = NULL, $banner_id = NULL, $username = NULL, $gender = NULL, $student_type = NULL, $application_term = NULL, $cell_phone = NULL, $meal_plan = NULL, $international = NULL, $waitlistReason = NULL, $oncampusReason = NULL, $oncampusOtherReason = NULL)
Severity: Major
Found in class/WaitingListApplication.php - About 1 hr to fix

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

    public function setRemove($removed_reason=UNASSIGN_NOREASON, $removed_by=null, $removed_on=null) {
        if ( is_null($removed_on) ) // use current time
            $this->removed_on = $this->getTimestamp();
        else
            $this->removed_on = $removed_on;
Severity: Major
Found in class/AssignmentHistory.php and 1 other location - About 1 hr to fix
class/AssignmentHistory.php on lines 117..129

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

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 delete()
    {
        if (is_null($this->id) || !isset($this->id)) {
            throw new \InvalidArgumentException('Invalid bed id.');
        }
Severity: Major
Found in class/Bed.php and 1 other location - About 1 hr to fix
class/Room.php on lines 107..122

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

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 setAssign($assign_reason=ASSIGN_NOREASON, $assigned_by=null, $assigned_on=null) {
        if ( is_null($assigned_on) ) // use current time
            $this->assigned_on = $this->getTimestamp();
        else
            $this->assigned_on = $assigned_on;
Severity: Major
Found in class/AssignmentHistory.php and 1 other location - About 1 hr to fix
class/AssignmentHistory.php on lines 139..151

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

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

Severity
Category
Status
Source
Language