AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

Function sendRoomChangeDeniedNotice has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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 isEnabledForStudent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isEnabledForStudent(ApplicationFeatureRegistration $feature, $term, Student $student)
    {
        $db = new PHPWS_DB('hms_application_feature');

        $db->addWhere('name', $feature->getName());
Severity: Minor
Found in class/ApplicationFeature.php - About 45 mins 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 show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {

        $autoassign = $this->AutoassignScheduleSet();

Severity: Minor
Found in class/PulseEditView.php - About 45 mins 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 show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

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

        $template = new \PHPWS_Template('hms');
        $template->setFile('admin/review_hall_email.tpl');
Severity: Minor
Found in class/ReviewHallNotificationMessageView.php - About 45 mins 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 logSwiftmailMessageLong has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function logSwiftmailMessageLong(\Swift_Message $message)
    {
        $fd = fopen(PHPWS_SOURCE_DIR . 'logs/email.log', 'a');
        fprintf($fd, "=======================\n");

Severity: Minor
Found in class/HMS_Email.php - About 45 mins 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 getUnassignedFreshmenApplications has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getUnassignedFreshmenApplications($term, $gender)
    {
        $db = new PHPWS_DB('hms_new_application');
        $db->addWhere('student_type', 'F');
        $db->addWhere('term', $term);
Severity: Minor
Found in class/HousingApplication.php - About 45 mins 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 send_lottery_roommate_reminder has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function send_lottery_roommate_reminder(Student $student, $name, $expires_on, $requestor_name, $hall_room, $year)
Severity: Minor
Found in class/HMS_Email.php - About 45 mins to fix

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

    public function execute()
    {
        foreach($this->getHalls() as $hall){
            $hallCount = \PHPWS_DB::getAssoc("select reason, count(*) from hms_assignment JOIN hms_bed ON hms_assignment.bed_id = hms_bed.id JOIN hms_room ON hms_bed.room_id = hms_room.id JOIN hms_floor ON hms_room.floor_id = hms_floor.id JOIN hms_residence_hall ON hms_floor.residence_hall_id = hms_residence_hall.id where hms_residence_hall.id = {$hall->getId()} AND hms_assignment.term = {$this->getTerm()} group by reason order by reason");

Severity: Minor
Found in class/Report/AssignmentTypeByFloor/AssignmentTypeByFloor.php - About 45 mins 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 render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

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

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

Severity: Minor
Found in class/Report/AssignmentTypeByFloor/AssignmentTypeByFloorHtmlView.php - About 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($term, $startDate, $endDate, HMS_RLC_Assignment $rlcAssignment = null, HMS_Assignment $roomAssignment = null, $roommateRequests)
Severity: Minor
Found in class/RlcSelfSelectionMenuBlockView.php - About 45 mins to fix

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

    public function __construct($id = 0, $user_id = null, $timestamp = null,
    $activity = null, $actor = null, $notes = null)
Severity: Minor
Found in class/HMS_Activity_Log.php - About 45 mins to fix

Function canLiveTogetherAdmin has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(Student $student, HMS_Assignment $assignment, ResidenceHall $hall, Floor $floor, Room $room, Checkin $checkin = null)
Severity: Minor
Found in class/CheckinFormView.php - About 45 mins to fix

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

    public function __construct(Student $student, ResidenceHall $hall, Room $room, Bed $bed, Array $damages = null, Checkin $checkin)
Severity: Minor
Found in class/CheckoutFormView.php - About 45 mins to fix

Method reportRoomAssignment has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function reportRoomAssignment($username, $term, $building, $room, $plan = 'HOME', $meal)
Severity: Minor
Found in contrib/SOAP.php - About 45 mins to fix

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

        if (strict && param.type === Syntax.Identifier && isRestrictedWord(param.name)) {
            throwErrorTolerant({}, Messages.StrictCatchVariable);
        }
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 2 other locations - About 45 mins to fix
javascript/react/build/JSXTransformer.js on lines 6016..6018
javascript/react/build/JSXTransformer.js on lines 6045..6047

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

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

Method sendContractToStudent has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function sendContractToStudent($student, $term, $docusignClient, $http, $templateId, $under18TemplateId)
Severity: Minor
Found in contrib/sendDocusignContract.php - About 45 mins to fix

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

            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                throwErrorTolerant({}, Messages.StrictLHSPrefix);
            }
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 2 other locations - About 45 mins to fix
javascript/react/build/JSXTransformer.js on lines 6016..6018
javascript/react/build/JSXTransformer.js on lines 7861..7863

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

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

            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                throwErrorTolerant({}, Messages.StrictLHSPostfix);
            }
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 2 other locations - About 45 mins to fix
javascript/react/build/JSXTransformer.js on lines 6045..6047
javascript/react/build/JSXTransformer.js on lines 7861..7863

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

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

        return (ch === 36) || (ch === 95) ||  // $ (dollar) and _ (underscore)
            (ch >= 65 && ch <= 90) ||         // A..Z
            (ch >= 97 && ch <= 122) ||        // a..z
            (ch === 92) ||                    // \ (backslash)
Severity: Minor
Found in javascript/react/build/JSXTransformer.js and 1 other location - About 45 mins to fix
javascript/react/build/JSXTransformer.js on lines 2695..2698

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

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