AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

Function scanJSXEntity has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function scanJSXEntity() {
        var ch, str = '', start = index, count = 0, code;
        ch = source[index];
        assert(ch === '&', 'Entity must start with an ampersand');
        index++;
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

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

        $now = time();
Severity: Minor
Found in class/ReapplicationWaitingListMenuBlockView.php - About 1 hr to fix

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

    public function execute(CommandContext $context){
        $options = array(
                ASSIGN_ADMIN             => 'Administrative',
                ASSIGN_LOTTERY             => 'Lottery',
                ASSIGN_FR                => 'Freshmen',
Severity: Minor
Found in class/Command/GetAssignmentTypeDropboxCommand.php - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        $id = $context->get('roommateId');
        if(is_null($id)) {
            throw new \InvalidArgumentException('Must set roommateId');
Severity: Minor
Found in class/Command/RoommateRequestCancelCommand.php - About 1 hr to fix

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

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

        $tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
Severity: Minor
Found in class/RoomChangeMenuBlockView.php - About 1 hr to fix

Function visitArrowFunction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function visitArrowFunction(traverse, node, path, state) {
  var notInExpression = (path[0].type === Syntax.ExpressionStatement);

  // Wrap a function into a grouping operator, if it's not
  // in the expression position.
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    public function execute(CommandContext $context){
        if(!\Current_User::allow('hms', 'edit_role_members')){
            throw new PermissionException('You do not have permission to edit role members.');
        }

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

Method __construct has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct()
    {
        parent::__construct();
        // Check permissions
        if(UserStatus::isAdmin()){
Severity: Minor
Found in class/ResidenceHallMenu.php - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        $id = $context->get('roommateId');
        if(is_null($id)) {
            throw new \InvalidArgumentException('Must set roommateId');
Severity: Minor
Found in class/Command/RoommateRejectCommand.php - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        $options = array();

        $options['assignment_type'] = array(
Severity: Minor
Found in class/Command/JSONGetOptionsCommand.php - About 1 hr to fix

Method formatException has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function formatException(\Exception $e)
    {
        ob_start();
        echo "Ohes Noes!  HMS threw an exception that was not caught!\n\n";
        echo "Host: {$_SERVER['SERVER_NAME']}({$_SERVER['SERVER_ADDR']})\n";
Severity: Minor
Found in class/HMS.php - About 1 hr to fix

Method countInvitesByClassGender has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function countInvitesByClassGender($term, $class, $gender = null)
    {
        $query = "SELECT count(*) FROM hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id
                    WHERE hms_lottery_application.invited_on IS NOT NULL
                    AND hms_new_application.term = $term ";
Severity: Minor
Found in class/LotteryProcess.php - About 1 hr to fix

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

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

        $id = $resp->getId();
Severity: Minor
Found in class/RoomDamageResponsibilityFactory.php - About 1 hr to fix

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

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

        $tpl['TITLE'] = 'Edit Move-in Times';

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

Method __construct has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct($sendMagicWinners, $sendReminders, Array $inviteCounts)
    {

        // Gender and classes
        $this->genders = array(
Severity: Minor
Found in class/LotteryProcess.php - About 1 hr to fix

Method increment has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function increment()
    {

        if($this->bedtime < 2) {
            $this->bedtime = 2;
Severity: Minor
Found in class/PreferenceValues.php - About 1 hr to fix

Method sendRoomChangeParticipantNotice has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function sendRoomChangeParticipantNotice(RoomChangeParticipant $requestor, RoomChangeParticipant $requestee)
    {
        $subject = 'Room Change Requested';
        $template = 'email/roomChangeParticipantNotice.tpl';
        $term = Term::getCurrentTerm();
Severity: Minor
Found in class/HMS_Email.php - About 1 hr to fix

Method canLiveTogetherAdmin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function canLiveTogetherAdmin(Student $roommate1, Student $roommate2, $term)
    {

        // Sanity Checking
        if (is_null($roommate1)) {
Severity: Minor
Found in class/HMS_Roommate.php - About 1 hr to fix

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

            if(isset($user['rlc_second_choice_id'])) {
                $db = new PHPWS_DB('hms_learning_communities');
                $db->addColumn('community_name');
                $db->addWhere('id', $user['rlc_second_choice_id']);
                $result = $db->select('one');
Severity: Major
Found in class/Command/ExportRlcAppsCommand.php and 1 other location - About 1 hr to fix
class/Command/ExportRlcAppsCommand.php on lines 86..96

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

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

            if(isset($user['rlc_third_choice_id'])) {
                $db = new PHPWS_DB('hms_learning_communities');
                $db->addColumn('community_name');
                $db->addWhere('id', $user['rlc_third_choice_id']);
                $result = $db->select('one');
Severity: Major
Found in class/Command/ExportRlcAppsCommand.php and 1 other location - About 1 hr to fix
class/Command/ExportRlcAppsCommand.php on lines 74..84

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

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