AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

Function show has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        if(!UserStatus::isAdmin()){
            throw new PermissionException('You are not allowed to view residence halls');
        }
Severity: Minor
Found in class/ResidenceHallView.php - About 1 hr 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

Method __construct has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($id = 0, $term = NULL, $banner_id = NULL, $username = NULL, $gender = NULL, $student_type = NULL, $application_term = NULL,
            $cell_phone = NULL, $meal_plan = NULL, $international = NULL, $lifestyle_option = NULL, $preferred_bedtime = NULL, $room_condition = NULL, $smoking_preference = NULL){
Severity: Major
Found in class/SpringApplication.php - About 1 hr to fix

Function calcGrandTotals has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private function calcGrandTotals()
    {
        foreach($this->hallSummaries as $hall){
            foreach($this->studentTypes as $t){
                // handle the 'other' type and skip the other types
Severity: Minor
Found in class/Report/AssignmentDemographics/AssignmentDemographics.php - About 1 hr 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

Function copy has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function copy($to_term, $assignments = FALSE, $roles = FALSE)
    {
        if (!$this->id) {
            return false;
        }
Severity: Minor
Found in class/ResidenceHall.php - About 1 hr 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

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

        if (ch1 === '>' && ch2 === '>' && ch3 === '=') {
            index += 3;
            return {
                type: Token.Punctuator,
                value: '>>=',
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 3219..3228

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

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 (ch1 === '<' && ch2 === '<' && ch3 === '=') {
            index += 3;
            return {
                type: Token.Punctuator,
                value: '<<=',
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 3230..3239

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

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

},{"_process":8,"path":7}],21:[function(_dereq_,module,exports){
/**
 * Copyright 2013 Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Function write has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
  var e, m, c,
      eLen = nBytes * 8 - mLen - 1,
      eMax = (1 << eLen) - 1,
      eBias = eMax >> 1,
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

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

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

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

},{"../src/utils":23,"esprima-fb":9}],34:[function(_dereq_,module,exports){
/**
 * Copyright 2014 Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

Method autoassign has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function autoassign()
    {
        echo "Apps:  " . count($this->applications) . "\n";
        echo "Pairs: " . count($this->pairs) . "\n";

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

Method show has 43 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/RlcSelfSelectionMenuBlockView.php - About 1 hr to fix

Method execute has 43 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: Minor
Found in class/Report/UnassignedBeds/UnassignedBeds.php - About 1 hr to fix

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

    public function addReportRunnerSchedule()
    {
        $pulse = \pulse\PulseFactory::getByName('ReportRunner', 'hms');
        if (!empty($pulse)) {
            throw new \Exception('Report Runner schedule is already present.');
Severity: Major
Found in class/Command/SavePulseOptionCommand.php and 1 other location - About 1 hr to fix
class/Command/SavePulseOptionCommand.php on lines 125..139

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

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 function addWithdrawnSchedule()
    {
        $pulse = \pulse\PulseFactory::getByName('Withdrawn', 'hms');
        if (!empty($pulse)) {
            throw new \Exception('Withdrawn schedule is already present.');
Severity: Major
Found in class/Command/SavePulseOptionCommand.php and 1 other location - About 1 hr to fix
class/Command/SavePulseOptionCommand.php on lines 103..117

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

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(HMS_Lottery::determineEligibility(UserStatus::getUsername())){
                $tpl['ICON'] = FEATURE_OPEN_ICON;
                $reAppCommand = CommandFactory::getCommand('ShowReApplication');
                $reAppCommand->setTerm($this->term);

Severity: Major
Found in class/ReapplicationMenuBlockView.php and 1 other location - About 1 hr to fix
class/RlcReapplicationMenuBlockView.php on lines 69..79

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

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

            }else{
                # Eligible
                $tpl['ICON'] = FEATURE_OPEN_ICON;
                $reAppCommand = CommandFactory::getCommand('ShowRlcReapplication');
                $reAppCommand->setTerm($this->term);
Severity: Major
Found in class/RlcReapplicationMenuBlockView.php and 1 other location - About 1 hr to fix
class/ReapplicationMenuBlockView.php on lines 62..76

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

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

    function skipMultiLineComment() {
        var start, loc, ch, comment;

        if (extra.comments) {
            start = index - 2;
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    public function show()
    {
        $tpl = array();
        $tpl['REVIEW_MSG']      = ''; // set this to show the review message

Severity: Minor
Found in class/FreshmenApplicationReview.php - About 1 hr to fix
Severity
Category
Status
Source
Language