AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

    function collectToken() {
        var loc, token, range, value, entry;

        /* istanbul ignore else */
        if (!state.inJSXChild) {
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    render() {
        // Get the damageType (name, desc, cost) from the list of damageTypes based on this damage's type id
        var dmgType = this.props.damageTypes[this.props.damage.damage_type];

        // Setup the list of students responsible for this damage
Severity: Minor
Found in javascript/damageAssessment/DamageAssessment.jsx - About 1 hr to fix

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

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

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

    public function execute(CommandContext $context)
    {
        $term = $context->get('term');
        if(!isset($term)){
            throw new \InvalidArgumentException('Missing term!');
Severity: Minor
Found in class/Command/AcceptDeclineRlcInviteCommand.php - About 1 hr to fix

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

function createState(source, rootNode, transformOptions) {
  return {
    /**
     * A tree representing the current local scope (and its lexical scope chain)
     * Useful for tracking identifiers from parent scopes, etc.
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    public function execute(CommandContext $context)
    {
        if(!\Current_User::allow('hms', 'lottery_admin')){
            throw new PermissionException('You do not have permission to administer re-application features.');
        }
Severity: Minor
Found in class/Command/LotteryAdminSetWinnerCommand.php - About 1 hr to fix

Method countOutstandingInvites has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function countOutstandingInvites($term, $class, $gender = null)
    {
        $now = time();
        $ttl = INVITE_TTL_HRS * 3600;

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

Method getAppByStudent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getAppByStudent(Student $student, $term, $applicationType = NULL)
    {
        $db = new \PHPWS_DB('hms_new_application');
        $db->addWhere('banner_id', $student->getBannerId());
        $db->addWhere('term', $term);
Severity: Minor
Found in class/HousingApplicationFactory.php - About 1 hr to fix

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

    public function show()
    {
        $approveCmd = CommandFactory::getCommand('RoomChangeStudentApprove');
        $approveCmd->setParticipantId($this->thisParticipant->getId());
        $approveCmd->setRequestId($this->request->getId());
Severity: Minor
Found in class/RoomChangeRequestStudentApprovalView.php - About 1 hr to fix

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

    public function show()
    {
        \PHPWS_Core::initCoreClass('Form.php');

        javascript('jquery');
Severity: Minor
Found in class/UnassignStudentView.php - About 1 hr to fix

Method get_assigned_to_link has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get_assigned_to_link($newWindow = FALSE)
    {
        $this->loadAssignment();

        if (isset($this->_curr_assignment)) {
Severity: Minor
Found in class/Bed.php - About 1 hr to fix

Method getApplicationByUser has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getApplicationByUser($username, $term, $applicationType = null)
    {
        $db = new PHPWS_DB('hms_new_application');
        $db->addWhere('username', $username);
        $db->addWhere('term', $term);
Severity: Minor
Found in class/HousingApplication.php - About 1 hr to fix

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

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

    public function show()
    {
        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/CreateTermView.php - About 1 hr to fix

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

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

  if (!noAssert) {
    checkInt(
      this, value, offset, byteLength,
      Math.pow(2, 8 * byteLength - 1) - 1,
      -Math.pow(2, 8 * byteLength - 1)
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 1333..1339

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

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

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

  if (!noAssert) {
    checkInt(
      this, value, offset, byteLength,
      Math.pow(2, 8 * byteLength - 1) - 1,
      -Math.pow(2, 8 * byteLength - 1)
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 1311..1317

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

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

ReactDOM.render(<RlcMembersList rlcId={window.rlcId} rlcName={window.rlcName} term={window.term}/>, document.getElementById('rlcMembers'));
Severity: Major
Found in javascript/rlcMembersList/rlcMembersList.jsx and 1 other location - About 1 hr to fix
javascript/StudentAddRoomDamages/roomDamage.jsx on lines 453..453

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

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

ReactDOM.render(<RoomDamageBox roomLocation={window.roomLocation} roomPID={window.roomPID} term={window.term}/>, document.getElementById('roomDamage'));
Severity: Major
Found in javascript/StudentAddRoomDamages/roomDamage.jsx and 1 other location - About 1 hr to fix
javascript/rlcMembersList/rlcMembersList.jsx on lines 401..401

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

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

    function parseClassElement() {
        var computed = false, generator = false, key, marker = markerCreate(),
            isStatic = false, possiblyOpenBracketToken;
        if (match(';')) {
            lex();
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix
Severity
Category
Status
Source
Language