AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

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

        $gender = $context->get('gender');
Severity: Minor
Found in class/Command/RoomChangeListAvailableBedsCommand.php - About 1 hr to fix

Method student_type has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function student_type($student_level)
{
    if ($student_level == 'G') {
        return 'G';
    }
Severity: Minor
Found in util/createfakestudents.php - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        // Check permissions
        if(!\Current_User::allow('hms', 'special_interest_approval')){
            throw new PermissionException('You do not have permission to approve special interest group requests.');
Severity: Minor
Found in class/Command/DenySpecialInterestCommand.php - About 1 hr to fix

Method count_assignments_by_class has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function count_assignments_by_class($term, $class)
    {
        $term_year = Term::getTermYear($term);

        $query = "SELECT count(*) from hms_assignment
Severity: Minor
Found in class/HMS_Lottery.php - About 1 hr to fix

Method count_outstanding_invites_by_class has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function count_outstanding_invites_by_class($term, $class)
    {
        $now = time();
        $term_year = Term::getTermYear($term);

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

Method count_remaining_entries_by_class has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function count_remaining_entries_by_class($term, $class)
    {
        $now = time();
        $term_year = Term::getTermYear($term);

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

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

    public function execute(CommandContext $context)
    {
        if(!\Current_User::allow('hms', 'room_structure')){
            throw new PermissionException('You do not have permission to add a room.');
        }
Severity: Minor
Found in class/Command/AddRoomCommand.php - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        $requestId = $context->get('requestId');
        $reason = $context->get('cancel-reason');

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

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

    public function execute(CommandContext $context)
    {
        // Check permissions
        if (!\Current_User::allow('hms', 'checkin')) {
            throw new PermissionException('You do not have permission to checkin students.');
Severity: Minor
Found in class/Command/StartCheckinSubmitCommand.php - About 1 hr to fix

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

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

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

Method count_avail_lottery_rooms has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function count_avail_lottery_rooms($gender, $rlcId = null)
    {
        $now = time();

        $db = PdoFactory::getPdoInstance();
Severity: Minor
Found in class/Floor.php - About 1 hr to fix

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

    public function show()
    {
        $submitCmd = CommandFactory::getCommand('AddRoomDamage');
        $submitCmd->setRoom($this->room);

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

Method sendRoomChangeDeniedNotice has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function sendRoomChangeDeniedNotice(RoomChangeRequest $r)
    {
        $subject = 'Room Change Denied';
        $template = 'email/roomChangeDeniedNotice.tpl';

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

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

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

        if($this->halls == NULL){
Severity: Minor
Found in class/SelectRoomView.php - About 1 hr to fix

Method sendRoomChangeInProcessNotice has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function sendRoomChangeInProcessNotice(RoomChangeRequest $r)
    {
        $subject = 'Room Change Approved!';
        $template = 'email/roomChangeApprovalNotice.tpl';

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

Method getCumulativeCountsByTerm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getCumulativeCountsByTerm($term)
    {
        // If the report is for fall, we really want Summer 1 and Summer 2 applications terms too.
        // So, build a list of extra application terms we should use.
        $extraTerms = array();

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

Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, true, 23, 4)
}
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 3 other locations - About 1 hr to fix
javascript/react/build/JSXTransformer.js on lines 1175..1178
javascript/react/build/JSXTransformer.js on lines 1180..1183
javascript/react/build/JSXTransformer.js on lines 1185..1188

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

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 4 locations. Consider refactoring.
Open

Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, false, 52, 8)
}
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 3 other locations - About 1 hr to fix
javascript/react/build/JSXTransformer.js on lines 1170..1173
javascript/react/build/JSXTransformer.js on lines 1175..1178
javascript/react/build/JSXTransformer.js on lines 1180..1183

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

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 4 locations. Consider refactoring.
Open

Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, true, 52, 8)
}
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 3 other locations - About 1 hr to fix
javascript/react/build/JSXTransformer.js on lines 1170..1173
javascript/react/build/JSXTransformer.js on lines 1175..1178
javascript/react/build/JSXTransformer.js on lines 1185..1188

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

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

        while (index < length) {
            if (match('}')) {
                break;
            }
            sourceElement = parseSourceElement();
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 1 other location - About 1 hr to fix
javascript/react/build/JSXTransformer.js on lines 6572..6581

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

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