AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

    function parseArrayInitialiser() {
        var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true,
            marker = markerCreate();

        expect('[');
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

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

        $tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
Severity: Major
Found in class/RlcApplicationMenuView.php - About 2 hrs to fix

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

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

        if (!isset($term)) {
Severity: Major
Found in class/Command/GetRoomDamagesToAssessCommand.php - About 2 hrs to fix

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

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

        if (empty($this->housingApps)) {
Severity: Major
Found in class/ProfileHousingAppList.php - About 2 hrs to fix

File HMS_Util.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Homestead;

/**
Severity: Minor
Found in class/HMS_Util.php - About 2 hrs to fix

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

    public static function getCurrentStateForParticipant(RoomChangeParticipant $participant)
    {
        $db = PdoFactory::getPdoInstance();

        $query = "SELECT * FROM hms_room_change_curr_participant WHERE participant_id = :participantId";
Severity: Major
Found in class/RoomChangeParticipantStateFactory.php and 1 other location - About 2 hrs to fix
class/RoomChangeRequestStateFactory.php on lines 7..21

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

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 getCurrentState(RoomChangeRequest $request)
    {
        $db = PdoFactory::getPdoInstance();

        $query = "SELECT * FROM hms_room_change_curr_request WHERE id = :requestId";
Severity: Major
Found in class/RoomChangeRequestStateFactory.php and 1 other location - About 2 hrs to fix
class/RoomChangeParticipantStateFactory.php on lines 7..23

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

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 Term.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Homestead;

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

HMS_Lottery has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class HMS_Lottery {

    /**
     * Looks for an entry with the 'magic_winner' flag set and returns it, otherwise it returns null
     */
Severity: Minor
Found in class/HMS_Lottery.php - About 2 hrs to fix

HMS_Util has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class HMS_Util{

    /**
     * Returns an array where the keys are numeric 1-12, values are text month names
     */
Severity: Minor
Found in class/HMS_Util.php - About 2 hrs to fix

RoomChangeParticipant has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class RoomChangeParticipant {

    protected $id;

    protected $request_id;
Severity: Minor
Found in class/RoomChangeParticipant.php - About 2 hrs to fix

Function parseObjectType has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function parseObjectType(allowStatic) {
        var callProperties = [], indexers = [], marker, optional = false,
            properties = [], propertyKey, propertyTypeAnnotation,
            token, isStatic, matchStatic;

Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

Function binaryPrecedence has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function binaryPrecedence(token, allowIn) {
        var prec = 0;

        if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
            return 0;
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

    public function execute(CommandContext $context){
        $term = Term::getSelectedTerm();

        $messageAll = \Current_User::allow('hms', 'email_all');

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

Function 39 has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./jsx":37,"jstransform":22,"jstransform/src/utils":23}],39:[function(_dereq_,module,exports){
/**
 * Copyright 2013-2015, Facebook, Inc.
 * All rights reserved.
 *
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

    public function show()
    {
        \Layout::addPageTitle("RLC Application");
        javascript('jquery');

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

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

    public function show()
    {
        $floor  = new Floor($this->floorId);

        $tpl = array();
Severity: Major
Found in class/LotteryChooseRoomView.php - About 2 hrs to fix

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

    public function show()
    {
        $tpl = array();
        $tpl['HALL_NAME']           = $this->hall->getLink();
        $tpl['FLOOR_NUMBER_LINK']   = $this->floor->getLink('Floor');
Severity: Major
Found in class/AddRoomView.php - About 2 hrs to fix

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

    public function show()
    {
        $f = $this->feature;
        $reg = $f->getRegistration();

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

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

        if(isset($this->cell_phone) && !is_null($this->cell_phone) && $this->cell_phone != ''){
            $tags['PHONE']      = '('.substr($this->cell_phone, 0, 3).')';
            $tags['PHONE']      .= substr($this->cell_phone, 3, 3);
            $tags['PHONE']      .= '-'.substr($this->cell_phone, 6, 4);
        }
Severity: Major
Found in class/WaitingListApplication.php and 3 other locations - About 2 hrs to fix
class/LotteryApplication.php on lines 292..296
class/LotteryApplication.php on lines 327..331
class/WaitingListApplication.php on lines 170..174

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

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