AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

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

        $tpl['COMMUNITY_NAME'] = $this->rlcAssignment->getRlcName();
Severity: Major
Found in class/RlcSelfAssignStartView.php - About 2 hrs to fix

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

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

        $submitCmd = CommandFactory::getCommand('LotteryConfirm');
Severity: Major
Found in class/LotteryConfirmView.php - About 2 hrs to fix

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

        if (matchKeyword('extends')) {
            expectKeyword('extends');
            previousYieldAllowed = state.yieldAllowed;
            state.yieldAllowed = false;
            superClass = parseLeftHandSideExpressionAllowCall();
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 8624..8633

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

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

        if (matchKeyword('extends')) {
            expectKeyword('extends');
            previousYieldAllowed = state.yieldAllowed;
            state.yieldAllowed = false;
            superClass = parseLeftHandSideExpressionAllowCall();
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 8661..8670

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

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 execute()
    {
        $this->lastTerm = Term::getPreviousYear($this->term);

        $thisTermDate     = $this->getCumulativeCountsByTerm($this->term);
class/Report/FreshmenApplicationsGraph/FreshmenApplicationsGraph.php on lines 40..56

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

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 execute()
    {
        $this->lastTerm = Term::getPreviousYear($this->term);

        $thisTermDate     = $this->getCumulativeCountsByTerm($this->term);
class/Report/CancelledAppsContinuingGraph/CancelledAppsContinuingGraph.php on lines 40..56

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

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

      else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
               && aOriginal && 'line' in aOriginal && 'column' in aOriginal
               && aGenerated.line > 0 && aGenerated.column >= 0
               && aOriginal.line > 0 && aOriginal.column >= 0
               && aSource) {
Severity: Critical
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

CommandContext has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class CommandContext {

    private $params = array();
    private $error = "";
    private $content = "";
Severity: Minor
Found in class/Command/CommandContext.php - About 2 hrs to fix

SOAP has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class SOAP
{

    // User types
    const ADMIN_USER    = 'A';
Severity: Minor
Found in class/SOAP.php - About 2 hrs to fix

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

    render(){
        var profileLink = "index.php?module=hms&action=ShowStudentProfile&username=" + this.props.node.username;
        var applicationLink = "index.php?module=hms&action=ShowRlcApplicationReView&appId=" + this.props.node.applicationId;
        var success = false;
        var danger = false;
Severity: Major
Found in javascript/rlcMembersList/rlcMembersList.jsx - About 2 hrs to fix

Function visitCallSpread has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function visitCallSpread(traverse, node, path, state) {
  utils.catchup(node.range[0], state);

  if (node.type === Syntax.NewExpression) {
    // Input  = new Set(1, 2, ...list)
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

    public function execute(CommandContext $context)
    {
        if(!\Current_User::allow('hms', 'view_rlc_members')){
            throw new PermissionException('You do not have permission to view RLC members.');
        }
Severity: Major
Found in class/Command/CreateCsvByRlcCommand.php - About 2 hrs to fix

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

    public function show()
    {
        if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'edit_terms')) {
            throw new PermissionException('You do not have permission to edit terms.');
        }
Severity: Major
Found in class/TermEditView.php - About 2 hrs to fix

File HMS_RLC_Assignment.php has 262 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Homestead;

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

Function 13 has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./util":19,"amdefine":20}],13:[function(_dereq_,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

},{"esprima-fb":9}],33:[function(_dereq_,module,exports){
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 */
/*global exports:true*/
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

Method plugSOAPData has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function plugSOAPData(&$student, $soapData)
    {
        $student->setBannerId($soapData->banner_id);
        $student->setUsername($soapData->user_name);

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

Method process has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function process($arguments)
{
    $dump_data = false;
    $term = get_term_default();

Severity: Major
Found in util/createfakestudents.php - About 2 hrs to fix

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

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

    public function execute(CommandContext $context) {
        if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'banner_queue')){
            throw new PermissionException('You do not have permission to enable/disable the Banner queue.');
        }

Severity: Minor
Found in class/Command/ProcessBannerQueueCommand.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