AppStateESS/homestead

View on GitHub

Showing 1,397 of 1,397 total issues

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

        while (index < length) {
            if (match('}')) {
                break;
            }
            statement = parseSourceElement();
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 8045..8054

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

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

Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, false, 23, 4)
}
Severity: Major
Found in javascript/react/build/JSXTransformer.js and 3 other locations - About 1 hr to fix
javascript/react/build/JSXTransformer.js on lines 1170..1173
javascript/react/build/JSXTransformer.js on lines 1180..1183
javascript/react/build/JSXTransformer.js on lines 1185..1188

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

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 __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($actee = NULL, $actor = NULL, $notes = NULL, $exact = false, $begin = NULL, $end = NULL, Array $activites = NULL, $static = false, $limit = 10)
Severity: Major
Found in class/ActivityLogPager.php - About 1 hr to fix

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

    public function __construct($actee = NULL, $actor = NULL, $notes = NULL, $exact = false, $begin = NULL, $end = NULL, Array $activities = NULL, $static = false, $limit = 10)
Severity: Major
Found in class/ActivityLogView.php - About 1 hr to fix

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

    public function __construct($term = null, $banner_id = null, $username = null, $gender = null, $student_type = null, $application_term = null, $cell_phone = null, $meal_plan = null, $international = null)
Severity: Major
Found in class/HousingApplication.php - About 1 hr to fix

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

    public function __construct(string $apiKey, Array $to, Array $cc, string $fromEmail, string $fromName, string $subject, string $text, string $html, Array $metadata)
Severity: Major
Found in class/Email/MandrillMessage.php - About 1 hr to fix

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

    dispatch: function (data, isError) {
        if (!isError) {
            for (var cb in this.validators) {
                if (!this.validators[cb](data)) {
                    isError = true;
Severity: Minor
Found in javascript/checkinStart/CardReader.js - About 1 hr to fix

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

    function isKeyword(id) {
        if (strict && isStrictModeReservedWord(id)) {
            return true;
        }

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

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

    function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
      var context = aContext || null;
      var order = aOrder || SourceMapConsumer.GENERATED_ORDER;

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

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

Buffer.byteLength = function byteLength (str, encoding) {
  var ret
  str = str + ''
  switch (encoding || 'utf8') {
    case 'ascii':
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

    dispatch: function (data, isError) {
        if (!isError) {
            for (var cb in this.validators) {
                if (!this.validators[cb](data)) {
                    isError = true;
Severity: Minor
Found in javascript/appCardSwipe/CardReader.js - About 1 hr to fix

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

$.fn.ajaxAddOption = function(url, params, select, fn, args)
{
    if(typeof(url) != "string") return this;
    if(typeof(params) != "object") params = {};
    if(typeof(select) != "boolean") select = true;
Severity: Minor
Found in javascript/jquery.selectboxes.js - About 1 hr to fix

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

    function parseClassDeclaration() {
        var id, implemented, previousYieldAllowed, superClass = null,
            superTypeParameters, marker = markerCreate(), typeParameters;

        expectKeyword('class');
Severity: Minor
Found in javascript/react/build/JSXTransformer.js - About 1 hr to fix

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

Buffer.prototype.slice = function slice (start, end) {
  var len = this.length
  start = ~~start
  end = end === undefined ? len : ~~end

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

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

    function parsePropertyFunction(options) {
        var previousStrict, previousYieldAllowed, previousAwaitAllowed,
            params, defaults, body, marker = markerCreate();

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

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

    var config = $.cookie = function (key, value, options) {

        // write
        if (value !== undefined) {
            options = $.extend({}, config.defaults, options);
Severity: Minor
Found in javascript/jqueryCookie/jquery.cookie.js - About 1 hr to fix

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

    componentDidMount(){
        let that = this;

        fetch('./index.php?module=hms&action=GetEmailLogMessageList&bannerId=' + this.props.studentId, {credentials: 'same-origin'})
            .then(function(response){
Severity: Minor
Found in javascript/emailLogView/emailLogView.jsx - About 1 hr to fix

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

    render(){
        if(this.props.alert === undefined || this.props.alert.message === "") {
            return (<div></div>)
        } else {
            var success = false;
Severity: Minor
Found in javascript/rlcMembersList/rlcMembersList.jsx - About 1 hr to fix

Method count_invites_by_class has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function count_invites_by_class($term, $class)
    {
        $now = time();
        $term_year = Term::getTermYear($term);

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

Method create_new_table has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function create_new_table($pdo)
{
    $table_name = TABLE_NAME;
    $query = <<<EOF
CREATE TABLE $table_name (
Severity: Minor
Found in util/createfakestudents.php - About 1 hr to fix
Severity
Category
Status
Source
Language