AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

            if(\PEAR::isError($result)){
                PHPWS_Error::logIfError($result);
                $tpl['errors'][] = array('USERNAME'=>$names[0], 'MESSAGE' => "DB error trying to update roommate requestee.");
            }else{
                # Check to see if something happened
Severity: Major
Found in class/HMS_Admin.php and 5 other locations - About 3 hrs to fix
class/HMS_Admin.php on lines 72..85
class/HMS_Admin.php on lines 92..104
class/HMS_Admin.php on lines 111..123
class/HMS_Admin.php on lines 130..142
class/HMS_Admin.php on lines 167..179

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

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 execute has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(CommandContext $context){
        $currentTerm = Term::getCurrentTerm();
        $username = UserStatus::getUsername();

        # Create a contact form command, redirect to it in case of error.
Severity: Minor
Found in class/Command/ShowStudentMenuCommand.php - About 3 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

Function show_verify_assignment has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

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

        $assignment = HMS_Assignment::get_assignment($_SESSION['asu_username'], $_SESSION['application_term']);
Severity: Minor
Found in class/UI/Student_UI.php - About 3 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

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

    public function execute(CommandContext $context)
    {

        if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'edit_terms')) {
            throw new PermissionException('You do not have permission to edit terms.');
Severity: Minor
Found in class/Command/CreateTermCommand.php - About 3 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

Function process has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in util/createfakestudents.php - About 3 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

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

    public function execute() {
        $db = new \PHPWS_DB('hms_new_application');
        $db->addColumn('hms_new_application.*');
        $db->addWhere('term', $this->term);
        $db->addWhere('cancelled', 0);
Severity: Minor
Found in class/Report/AppliedStudentData/AppliedStudentData.php - About 3 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

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

    public function show()
    {
        require_once(PHPWS_SOURCE_DIR . 'mod/hms/inc/profile_options.php');

        $template = array();
Severity: Minor
Found in class/RoommateProfileFormView.php - About 3 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

Function 24 has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./docblock":21,"esprima-fb":9}],24:[function(_dereq_,module,exports){
/**
 * Copyright 2013 Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 3 hrs to fix

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

    public function show()
    {
        // Get a username list of all participants
        $participantUsernames = $this->request->getParticipantUsernames();

Severity: Major
Found in class/RoomChangeManageView.php - About 3 hrs to fix

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

},{"../src/utils":23,"./es6-destructuring-visitors":27,"./es6-rest-param-visitors":30,"esprima-fb":9}],25:[function(_dereq_,module,exports){
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 */
/*global exports:true*/
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 3 hrs to fix

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

    public function execute(CommandContext $context){

        // Make sure the user has permission to change room attributes
        if(!\Current_User::allow('hms', 'room_attributes')){
            echo json_encode(false);
Severity: Major
Found in class/Command/UpdateRoomFieldCommand.php - About 3 hrs to fix

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

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

HMS_RLC_Assignment has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

class HMS_RLC_Assignment {

    public $id;

    public $rlc_id;
Severity: Minor
Found in class/HMS_RLC_Assignment.php - About 3 hrs to fix

ReportController has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class ReportController {

    // The report object we're controlling/wraping.
    protected $report;

Severity: Minor
Found in class/ReportController.php - About 3 hrs to fix

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

    public function execute(CommandContext $context)
    {

        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/Command/CreateTermCommand.php - About 3 hrs to fix

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

    public function setHousingWaiver($bannerId, $term)
    {
        $params = array(
                        'User'      => $this->currentUser,
                        'BannerID'  => $bannerId,
Severity: Major
Found in class/PhpSOAP.php and 1 other location - About 3 hrs to fix
class/PhpSOAP.php on lines 393..413

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

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 clearHousingWaiver($bannerId, $term)
    {
        $params = array(
                        'User'      => $this->currentUser,
                        'BannerID'  => $bannerId,
Severity: Major
Found in class/PhpSOAP.php and 1 other location - About 3 hrs to fix
class/PhpSOAP.php on lines 371..391

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

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

Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset]) |
    (this[offset + 1] << 8) |
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 1 other location - About 3 hrs to fix
javascript/react/build/JSXTransformer.js on lines 1080..1087

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

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

Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return ((this[offset]) |
      (this[offset + 1] << 8) |
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 1 other location - About 3 hrs to fix
javascript/react/build/JSXTransformer.js on lines 1152..1159

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

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

    {
        name: 'studentSearch',
        display: 'banner_id',
        limit: 5,
        source: studentSearchSource.ttAdapter(),
Severity: Major
Found in javascript/checkinStart/script.js and 1 other location - About 3 hrs to fix
javascript/studentSearch/script.js on lines 54..67

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

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