CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function cardNo()
    {
        if(func_num_args() == 0) {
            return $this->getColumn('cardNo');
        } else if (func_num_args() > 1) {
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 41..52
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 67..78
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 45..56
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 58..69
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 71..82
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 84..95
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 97..108
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 110..121
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 123..134

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

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

    public function hoursRedeemed()
    {
        if(func_num_args() == 0) {
            return $this->getColumn('hoursRedeemed');
        } else if (func_num_args() > 1) {
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 41..52
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 54..65
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 67..78
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 45..56
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 58..69
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 71..82
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 84..95
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 97..108
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 123..134

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

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

    public function tdate()
    {
        if(func_num_args() == 0) {
            return $this->getColumn('tdate');
        } else if (func_num_args() > 1) {
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 41..52
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 54..65
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 67..78
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 45..56
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 71..82
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 84..95
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 97..108
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 110..121
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 123..134

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

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

foreach ($data as $k => $row) {
    if ($dbc->getValue($narrowP, array($row['upc'], $store))) {
        $row['full'] = false;
        $row['movementTag'] = $dbc->getValue($mtP, array($row['upc'], $store));
        $half[] = $row;
Severity: Major
Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid.php and 1 other location - About 3 hrs to fix
fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php on lines 165..175

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

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

foreach ($data as $k => $row) {
    if ($dbc->getValue($narrowP, array($row['upc'], $store))) {
        $row['full'] = false;
        $row['movementTag'] = $dbc->getValue($mtP, array($row['upc'], $store));
        $half[] = $row;
Severity: Major
Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php and 1 other location - About 3 hrs to fix
fannie/admin/labels/pdf_layouts/WFC_Hybrid.php on lines 165..175

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

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

    public function volunteerHoursAccountMapID()
    {
        if(func_num_args() == 0) {
            return $this->getColumn('volunteerHoursAccountMapID');
        } else if (func_num_args() > 1) {
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 54..65
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 67..78
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 45..56
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 58..69
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 71..82
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 84..95
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 97..108
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 110..121
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 123..134

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

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

    public function volunteerHoursActivityID()
    {
        if(func_num_args() == 0) {
            return $this->getColumn('volunteerHoursActivityID');
        } else if (func_num_args() > 1) {
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 41..52
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 54..65
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 67..78
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 58..69
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 71..82
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 84..95
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 97..108
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 110..121
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 123..134

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

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

    public function uid()
    {
        if(func_num_args() == 0) {
            return $this->getColumn('uid');
        } else if (func_num_args() > 1) {
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 41..52
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 54..65
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 67..78
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 45..56
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 58..69
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 71..82
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 84..95
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 110..121
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 123..134

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

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

    public function hoursWorked()
    {
        if(func_num_args() == 0) {
            return $this->getColumn('hoursWorked');
        } else if (func_num_args() > 1) {
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 41..52
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 54..65
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursAccountMapModel.php on lines 67..78
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 45..56
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 58..69
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 71..82
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 97..108
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 110..121
fannie/modules/plugins2.0/VolunteerHours/models/VolunteerHoursActivityModel.php on lines 123..134

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

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

            foreach ($sale as $row) {
                $pdf->SetX($posX);
                if (!empty($row[0])) {
                    $pdf->Cell(60, 5, str_replace('bold', '', $row[0]), 1, 0, 'L');
                    $pdf->Cell(20, 5, $header ? 'Qty' : '', 1, 0, 'L');
Severity: Major
Found in fannie/modules/plugins2.0/RP/RpDailyPage.php and 1 other location - About 3 hrs to fix
fannie/modules/plugins2.0/RP/RpDailyPage.php on lines 154..164

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

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

            foreach ($stock as $row) {
                $pdf->SetX($posX);
                if (!empty($row[0])) {
                    $pdf->Cell(60, 5, str_replace('bold', '', $row[0]), 1, 0, 'L');
                    $pdf->Cell(20, 5, $header ? 'Qty' : '', 1, 0, 'L');
Severity: Major
Found in fannie/modules/plugins2.0/RP/RpDailyPage.php and 1 other location - About 3 hrs to fix
fannie/modules/plugins2.0/RP/RpDailyPage.php on lines 170..180

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

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

            for (i=0; i<hIDs.length; i++) {
                var elemID = hIDs[i];
                var elem = $('#'+elemID);
                $(elem).val(state['onHand'][elemID]);
                mod.reCalcRow($(elem).closest('tr'));
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpFloral.js and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDirect.js on lines 168..173
fannie/modules/plugins2.0/RP/rpDual.js on lines 169..174
fannie/modules/plugins2.0/RP/rpDual.js on lines 176..181
fannie/modules/plugins2.0/RP/rpOrder.js on lines 164..169

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

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

            for (i=0; i<hIDs.length; i++) {
                var elemID = hIDs[i];
                var elem = $('#'+elemID);
                $(elem).val(state['onHand'][elemID]);
                mod.reCalcRow($(elem).closest('tr'));
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpDirect.js and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDual.js on lines 169..174
fannie/modules/plugins2.0/RP/rpDual.js on lines 176..181
fannie/modules/plugins2.0/RP/rpFloral.js on lines 76..81
fannie/modules/plugins2.0/RP/rpOrder.js on lines 164..169

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

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

            for (i=0; i<hIDs.length; i++) {
                var elemID = hIDs[i];
                var elem = $('#'+elemID);
                $(elem).val(state['onHand'][elemID]);
                mod.reCalcRow($(elem).closest('tr'));
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpOrder.js and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDirect.js on lines 168..173
fannie/modules/plugins2.0/RP/rpDual.js on lines 169..174
fannie/modules/plugins2.0/RP/rpDual.js on lines 176..181
fannie/modules/plugins2.0/RP/rpFloral.js on lines 76..81

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

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

            for (i=0; i<hIDs.length; i++) {
                var elemID = hIDs[i];
                var elem = $('#'+elemID);
                $(elem).val(state['onHand1'][elemID]);
                mod.reCalcRow($(elem).closest('tr'));
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpDual.js and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDirect.js on lines 168..173
fannie/modules/plugins2.0/RP/rpDual.js on lines 176..181
fannie/modules/plugins2.0/RP/rpFloral.js on lines 76..81
fannie/modules/plugins2.0/RP/rpOrder.js on lines 164..169

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

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

            for (i=0; i<hIDs.length; i++) {
                var elemID = hIDs[i];
                var elem = $('#'+elemID);
                $(elem).val(state['onHand2'][elemID]);
                mod.reCalcRow($(elem).closest('tr'));
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpDual.js and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDirect.js on lines 168..173
fannie/modules/plugins2.0/RP/rpDual.js on lines 169..174
fannie/modules/plugins2.0/RP/rpFloral.js on lines 76..81
fannie/modules/plugins2.0/RP/rpOrder.js on lines 164..169

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

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

    public function lookupTransaction($ref, $local, $mode)
    {
        $wsParams = array(
            'merchant' => $this->conf->get('MercuryE2ETerminalID'),
            'pw' => $this->conf->get('MercuryE2EPassword'),
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/MercuryE2E.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 get has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

static public function get($session)
{
    $DESIRED_TENDERS = is_array($session->get("TRDesiredTenders")) ? $session->get('TRDesiredTenders') : array();

    $DESIRED_TENDERS = array_merge($DESIRED_TENDERS, array(

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

    private function logActivity($dbc, $depts)
    {
        $errors = array();
        $dlist = "(";
        $case_args = array();
Severity: Minor
Found in fannie/cron/tasks/ArHistoryTask.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 get_id_view has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_id_view()
    {
        global $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);

Severity: Minor
Found in fannie/batches/UNFI/RecalculateVendorSRPs.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

Severity
Category
Status
Source
Language