AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

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

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

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

    function parse(code, options) {
        var program, toString;

        toString = String;
        if (typeof code !== 'string' && !(code instanceof String)) {
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 3 hrs to fix

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

    $.fn.ajaxForm = function(options) {
        
        // Gather user options
        var opts = $.extend({}, $.fn.ajaxForm.defaults, options);
        
Severity: Major
Found in javascript/ajaxForm/jquery.ajaxForm.js - About 3 hrs to fix

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

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

        // Load the student
Severity: Minor
Found in class/Command/RlcSelfSelectInviteSaveCommand.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 22 (exceeds 5 allowed). Consider refactoring.
Open

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

        $messageAll = \Current_User::allow('hms', 'email_all');

Severity: Minor
Found in class/Command/ListAllowedHallsCommand.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 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        // This hack is the most awful hack ever.  Fix phpWebSite so that
        // user logins are logged separately.
        if(\Current_User::isLogged() && !isset($_SESSION['HMS_LOGGED_THE_LOGIN'])) {
Severity: Minor
Found in class/HMS.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 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        /*** Header Info ***/
        $tpl = array();
        $tpl['ROOM_PERSISTENT_ID'] = $this->room->getPersistentId();
Severity: Minor
Found in class/RoomView.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

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

    public function execute(CommandContext $context)
    {

        $term = $context->get('term');
        $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
Severity: Major
Found in class/Command/SubmitRlcApplicationCommand.php - About 3 hrs to fix

Method getStudentProfile has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getStudentProfile($bannerId, $term)
    {
        // Sanity checking on the username
        if(empty($bannerId) || is_null($bannerId) || !isset($bannerId)){
            throw new \InvalidArgumentException('Bad BannerId.');
Severity: Major
Found in class/TestSOAP.php - About 3 hrs to fix

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

        switch($result['application_type']){
            case 'fall':
                $app = new FallApplication($result['id']);
                break;
            case 'spring':
Severity: Major
Found in class/HousingApplicationFactory.php and 1 other location - About 3 hrs to fix
class/HousingApplication.php on lines 417..435

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

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

        switch($result['application_type']) {
            case 'fall':
                $app = new FallApplication($result['id']);
                break;
            case 'spring':
Severity: Major
Found in class/HousingApplication.php and 1 other location - About 3 hrs to fix
class/HousingApplicationFactory.php on lines 96..114

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

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

    state.g.sourceMap.addMapping({
      generated: { line: state.g.bufferLine, column: state.g.bufferColumn },
      original: { line: state.g.sourceLine, column: state.g.sourceColumn },
      source: state.g.sourceMapFilename
    });
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 12961..12965

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

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

    state.g.sourceMap.addMapping({
      generated: { line: state.g.bufferLine, column: state.g.bufferColumn },
      original: { line: state.g.sourceLine, column: state.g.sourceColumn },
      source: state.g.sourceMapFilename
    });
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 12772..12776

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

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

    function parseExportDeclaration() {
        var declaration = null,
            possibleIdentifierToken, sourceElement,
            isExportFromIdentifier,
            src = null, specifiers = [],
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 3 hrs to fix

HMS_Assignment has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class HMS_Assignment extends HMS_Item {

    public $asu_username = null;
    public $banner_id;
    public $bed_id = 0;
Severity: Minor
Found in class/HMS_Assignment.php - About 3 hrs to fix

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

    public function execute()
    {
        $term = $this->term;

        $sem = Term::getTermSem($term);
Severity: Major
Found in class/Report/UnassignedFreshmen/UnassignedFreshmen.php - About 3 hrs to fix

Method getProfileView has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getProfileView()
    {
        $studentUsername = $this->student->getUsername();
        $assignment = HMS_Assignment::getAssignmentByBannerId($this->student->getBannerId(), $this->term);

Severity: Major
Found in class/StudentProfile.php - About 2 hrs to fix

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

},{"../src/utils":23,"esprima-fb":9}],37:[function(_dereq_,module,exports){
/**
 * Copyright 2013-2015, Facebook, Inc.
 * All rights reserved.
 *
Severity: Major
Found in javascript/react/build/JSXTransformer.js - About 2 hrs to fix

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

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

        $tpl['NAME'] = $this->student->getFullName();
Severity: Major
Found in class/ReApplicationOffCampusFormView.php - About 2 hrs to fix

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

    public function show()
    {
        $term = Term::getSelectedTerm();

        $db = new PHPWS_DB('hms_residence_hall');
Severity: Major
Found in class/StatsView.php - About 2 hrs to fix
Severity
Category
Status
Source
Language