AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
  if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
  else if (byteOffset < -0x80000000) byteOffset = -0x80000000
  byteOffset >>= 0

Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    function collectRegex() {
        var pos, loc, regex, token;

        skipComment();

Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    function parseDeclareFunction() {
        var id, idMarker,
            marker = markerCreate(), params, returnType, rest, tmp,
            typeParameters = null, value, valueMarker;

Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    public function show()
    {
        javascript('jquery');
        javascript('jquery_ui');
        javascript('select2');
Severity: Minor
Found in class/CheckoutStartView.php - About 1 hr to fix

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

    public function show()
    {
        javascript('jquery');
        javascript('jquery_ui');
        javascript('select2');
Severity: Minor
Found in class/CheckinStartView.php - About 1 hr to fix

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

    render(){
        var backUrl = "index.php?module=hms&action=ShowSearchByRlc"
        var addMembersUrl = "index.php?module=hms&action=ShowAdminAddRlcMember&communityId=" + this.props.rlcId;
        var exportUrl = "index.php?module=hms&action=CreateCsvByRlc&id=" + this.props.rlcId

Severity: Minor
Found in javascript/rlcMembersList/rlcMembersList.jsx - About 1 hr to fix

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

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

        $tpl['TERM'] = Term::toString($this->term) . ' - ' . Term::toString(Term::getNextTerm($this->term));
Severity: Minor
Found in class/LotteryChooseHallView.php - About 1 hr to fix

Method getAddress has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getAddress($type = null)
    {
        $pr_address = null;
        $ps_address = null;

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

Method sendRoomChangeCancelledNotice has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function sendRoomChangeCancelledNotice(RoomChangeRequest $r, Student $canceller = null)
    {
        $subject = 'Room Change Cancelled';
        $template = 'email/roomChangeCancelledNotice.tpl';

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

Method getMembership has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getMembership($permission=null, $object=null, $username=null, $display_name=false){
        $db = self::getDb();
        $db->addJoin('left outer', 'hms_permission', 'hms_role_perm', 'id', 'permission');
        $db->addJoin('left outer', 'hms_role_perm', 'hms_role', 'role', 'id');
        $db->addJoin('left outer', 'hms_role', 'hms_user_role', 'id', 'role');
Severity: Minor
Found in class/HMS_Permission.php - About 1 hr to fix

Method count_beds_per_room has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function count_beds_per_room()
    {
        $total = array(); // stores the number of rooms with that many beds

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

Method count_avail_lottery_rooms has 32 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/ResidenceHall.php - About 1 hr to fix

Method assign has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function assign(AssignmentPairing $pair, Room $room)
    {
        if(!$this->allowed($pair, $room)) {
            throw new AssignmentException('Cannot assign ' . $pair->__tostring() . ' to ' . $room->__tostring());
        }
Severity: Minor
Found in class/AssignmentStrategy.php - About 1 hr to fix

Function createFunctionExpression has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

        createFunctionExpression: function (id, params, defaults, body, rest, generator, expression,
                                            isAsync, returnType, typeParameters) {
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

Function createFunctionDeclaration has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

        createFunctionDeclaration: function (id, params, defaults, body, rest, generator, expression,
                                             isAsync, returnType, typeParameters) {
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        $term = $context->get('term');

        $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
Severity: Minor
Found in class/Command/ShowFreshmenApplicationReviewCommand.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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(CommandContext $context)
    {
        if(!\Current_User::allow('hms', 'cancel_housing_application')){
            throw new PermissionException('You do not have permission to cancel housing applications.');
        }
Severity: Minor
Found in class/Command/CancelHousingApplicationCommand.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 doPairing has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function doPairing(&$applications, &$pairs)
    {
        $keys = $this->sort($applications);

        while(count($applications) > 1) {
Severity: Minor
Found in class/PreferencesRoommatePairingStrategy.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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(CommandContext $context)
    {

        $term = $context->get('term');

Severity: Minor
Found in class/Command/ShowRlcApplicationPage2ViewCommand.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 countGrossApplicationsByClassGender has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

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

        $query = "SELECT count(*) from hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id
Severity: Minor
Found in class/LotteryProcess.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

Severity
Category
Status
Source
Language