AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

Function render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        if(this.state.fetchingIds){
            return (<div>
                            <i className="fa fa-spinner fa-spin fa-2x fa-fw"></i>Loading message list...
                            <span className="sr-only">Loading...</span>
Severity: Minor
Found in javascript/emailLogView/emailLogView.jsx - About 1 hr to fix

Method execute has 34 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/RoomChangeStudentApproveCommand.php - About 1 hr to fix

Method getAdminCsvRow has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getAdminCsvRow()
    {
        $row = array();

        // Get the RLC Application
Severity: Minor
Found in class/HMS_RLC_Assignment.php - About 1 hr to fix

Method chooseWinner has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function chooseWinner($class, $gender)
    {
        $query = "SELECT * FROM hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id
                    LEFT OUTER JOIN (SELECT asu_username FROM hms_assignment WHERE term={$this->term}) as foo ON hms_new_application.username = foo.asu_username
                    WHERE foo.asu_username IS NULL
Severity: Minor
Found in class/LotteryProcess.php - About 1 hr to fix

Method save has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function save()
    {
        $db = PdoFactory::getPdoInstance();

        // Begin a new transaction
Severity: Minor
Found in class/RoomChangeParticipant.php - About 1 hr to fix

Method can_live_together has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function can_live_together()
    {
        $requestor = strToLower($this->requestor);
        $requestee = strToLower($this->requestee);
        $term = $this->term;
Severity: Minor
Found in class/HMS_Roommate.php - About 1 hr to fix

Method populateSharedFields has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function populateSharedFields($term, Student $student)
    {
        $this->app->setTerm($term);
        $this->app->setBannerId($student->getBannerId());
        $this->app->setUsername($student->getUsername());
Severity: Minor
Found in class/ContextApplicationFactory.php - About 1 hr to fix

Method render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function render(){
        parent::render();

        $this->tpl['TERM'] = Term::toString($this->report->getTerm());

Method roomSearch has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function roomSearch($gender = FALSE, $lifestyle = FALSE, $pbuilding = FALSE, $pfloor = FALSE, $proom = FALSE)
    {
        $pre_sql = "SELECT hms_room.*, sub.banner_building_code FROM (SELECT hms_room.id, hms_residence_hall.banner_building_code ,  (count(hms_bed.id)) AS bed_count FROM hms_residence_hall INNER JOIN hms_floor ON hms_residence_hall.id = hms_floor.residence_hall_id  INNER JOIN hms_room ON hms_floor.id = hms_room.floor_id  INNER JOIN hms_bed ON hms_room.id = hms_bed.room_id  LEFT OUTER JOIN hms_assignment ON hms_bed.id = hms_assignment.bed_id WHERE hms_assignment.asu_username IS NULL AND hms_room.offline = 0 AND hms_room.reserved = 0 AND hms_room.ra = 0 AND hms_room.overflow = 0 AND hms_room.private = 0 AND hms_room.parlor = 0 AND hms_room.term = '{$this->term}' AND hms_floor.is_online = 1 AND hms_residence_hall.is_online = 1 ";
        $post_sql = " GROUP BY hms_residence_hall.banner_building_code, hms_room.id) AS sub INNER JOIN hms_room ON sub.id = hms_room.id WHERE sub.bed_count = 2 ORDER BY random() LIMIT 1";

Severity: Minor
Found in class/AssignmentStrategy.php - About 1 hr to fix

Method run_assigned_type_f has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function run_assigned_type_f(){

        $term = Term::getSelectedTerm();

        $db = new PHPWS_DB('hms_assignment');
Severity: Minor
Found in class/HMS_Reports.php - About 1 hr to fix

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

    constructor(props){
        super(props);

        this.toggleFormVisibility = this.toggleFormVisibility.bind(this);
        this.add = this.add.bind(this);
Severity: Major
Found in javascript/RoomDamages/RoomDamages.jsx and 1 other location - About 1 hr to fix
javascript/RoomDamages/RoomDamages.jsx on lines 184..189

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

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

                        <div>
                            <label>
                                <input name="keyReturned" onChange={this.keyTurnIn} type="radio" value='false'/>{' '} Key not returned
                            </label>
                        </div>
Severity: Major
Found in javascript/CheckOut/CheckOut.jsx and 1 other location - About 1 hr to fix
javascript/CheckOut/CheckOut.jsx on lines 162..166

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

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

    constructor(props){
        super(props);

        this.add = this.add.bind(this);
        this.hideForm = this.hideForm.bind(this);
Severity: Major
Found in javascript/RoomDamages/RoomDamages.jsx and 1 other location - About 1 hr to fix
javascript/RoomDamages/RoomDamages.jsx on lines 155..160

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

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

                        <div>
                            <label>
                                <input name="keyReturned" onChange={this.keyTurnIn} type="radio" value='true'/>{' '} Key returned
                            </label>
                        </div>
Severity: Major
Found in javascript/CheckOut/CheckOut.jsx and 1 other location - About 1 hr to fix
javascript/CheckOut/CheckOut.jsx on lines 167..171

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

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

Consider simplifying this complex logical expression.
Open

      if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
          && aGenerated.line > 0 && aGenerated.column >= 0
          && !aOriginal && !aSource && !aName) {
        // Case 1.
        return;
Severity: Critical
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        if(empty($applicationTerm) || empty($studentType) ||
        empty($studentClass) ||
        empty($dob) ||
        $gender === '' || $gender === 'N' || $gender === null ||
        is_null($dob))
Severity: Critical
Found in class/Command/ShowStudentMenuCommand.php - About 1 hr to fix

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

    public function show()
    {
        $pager = new \DBPager('hms_roommate', '\Homestead\HMS_Roommate');

        $pager->db->addWhere('confirmed', 1);
Severity: Major
Found in class/ConfirmedRoommatePager.php and 1 other location - About 1 hr to fix
class/HMS_Roommate.php on lines 773..789

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

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 roommate_pager()
    {
        $pager = new \DBPager('hms_roommate', '\Homestead\HMS_Roommate');

        $pager->db->addWhere('confirmed', 1);
Severity: Major
Found in class/HMS_Roommate.php and 1 other location - About 1 hr to fix
class/ConfirmedRoommatePager.php on lines 10..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 107.

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

    function parseUnaryExpression() {
        var marker, token, expr;

        if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
            return parsePostfixExpression();
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Function parseClassBody has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function parseClassBody() {
        var classElement, classElements = [], existingProps = {},
            marker = markerCreate(), propName, propType;

        existingProps[ClassPropertyType["static"]] = new StringMap();
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix
Severity
Category
Status
Source
Language