CORE-POS/IS4C

View on GitHub

Showing 1,963 of 8,684 total issues

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

                <p>
                    <div className="input-group">
                        <span className="input-group input-group-addon">Start Date</span>
                        <input type="text" className="form-control date-field" value={this.props.startDate}
                            onChange={(ev) => this.props.manageData.start(ev.target.value)} />
Severity: Major
Found in fannie/batches/EndCapper/src/ToolBar.js and 2 other locations - About 4 hrs to fix
fannie/batches/EndCapper/src/ToolBar.js on lines 138..144
fannie/batches/EndCapper/src/ToolBar.js on lines 152..158

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

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

                <p>
                    <div className="input-group">
                        <span className="input-group input-group-addon">Name</span>
                        <input type="text" className="form-control" value={this.props.ecName}
                            onChange={(ev) => this.props.manageData.save(ev.target.value)} />
Severity: Major
Found in fannie/batches/EndCapper/src/ToolBar.js and 2 other locations - About 4 hrs to fix
fannie/batches/EndCapper/src/ToolBar.js on lines 145..151
fannie/batches/EndCapper/src/ToolBar.js on lines 152..158

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

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

        $data[] = array(
            'Sales',
            number_format($total_sales->lastYear, 0),
            number_format($total_sales->projected, 0),
            '',
fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 719..733

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

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 ($item['originShortName'] != '') {
                $pdf->SetXY($this->left, $this->top + ($this->height*$row) + ($this->height - $this->top - 20));
                $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
                $lower = trim(strtolower($item['originShortName']));
                if (substr($lower, 0, 10) !== 'product of') {
Severity: Major
Found in fannie/classlib2.0/item/signage/Giganto2UpP.php and 1 other location - About 4 hrs to fix
fannie/classlib2.0/item/signage/Signage2UpP.php on lines 122..130

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

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 ($item['originShortName'] != '') {
            $pdf->SetXY($this->left, $this->top + ($this->height*$row) + ($this->height - $this->top - 20));
            $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
            $lower = trim(strtolower($item['originShortName']));
            if (substr($lower, 0, 10) !== 'product of') {
Severity: Major
Found in fannie/classlib2.0/item/signage/Signage2UpP.php and 1 other location - About 4 hrs to fix
fannie/classlib2.0/item/signage/Giganto2UpP.php on lines 132..157

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

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

        $data[] = array(
            'Sales',
            number_format($total_sales->lastYear, 0),
            number_format($total_sales->projected, 0),
            '',
fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 645..659

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

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

        if ($transNum) {
            $dlog = $this->config->get('TRANS_DB') . $this->connection->sep() . 'dlog';
            $correctP = $this->connection->prepare("
                SELECT *
                FROM {$dlog}
Severity: Major
Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php on lines 355..377

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

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

        if ($transNum) {
            $dlog = $this->config->get('TRANS_DB') . $this->connection->sep() . 'dlog';
            $correctP = $this->connection->prepare("
                SELECT *
                FROM {$dlog}
Severity: Major
Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php on lines 355..377

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

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

<?php
include(dirname(__FILE__) . '/../../../config.php');
if (!class_exists('FannieAPI')) {
    include(dirname(__FILE__) . '/../../../classlib2.0/FannieAPI.php');
}
Severity: Major
Found in fannie/modules/plugins2.0/TargetedPromos/DefectorList.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/TargetedPromos/DevelopersList.php on lines 1..37

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

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

<?php
include(dirname(__FILE__) . '/../../../config.php');
if (!class_exists('FannieAPI')) {
    include(dirname(__FILE__) . '/../../../classlib2.0/FannieAPI.php');
}
Severity: Major
Found in fannie/modules/plugins2.0/TargetedPromos/DevelopersList.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/TargetedPromos/DefectorList.php on lines 1..36

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

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

    mod.inc = function(btn, amt) {
        var elem = $(btn).parent().find('input.orderAmt');
        var next = ($(elem).val() * 1) + amt;
        if (next < 0) {
            next = 0;
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpDirect.js and 3 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDual.js on lines 328..336
fannie/modules/plugins2.0/RP/rpFloral.js on lines 163..171
fannie/modules/plugins2.0/RP/rpOrder.js on lines 296..304

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

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

    mod.inc = function(btn, amt) {
        var elem = $(btn).parent().find('input.orderAmt');
        var next = ($(elem).val() * 1) + amt;
        if (next < 0) {
            next = 0;
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpOrder.js and 3 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDirect.js on lines 336..344
fannie/modules/plugins2.0/RP/rpDual.js on lines 328..336
fannie/modules/plugins2.0/RP/rpFloral.js on lines 163..171

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

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

    mod.inc = function(btn, amt) {
        var elem = $(btn).parent().find('input.orderAmt');
        var next = ($(elem).val() * 1) + amt;
        if (next < 0) {
            next = 0;
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpDual.js and 3 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDirect.js on lines 336..344
fannie/modules/plugins2.0/RP/rpFloral.js on lines 163..171
fannie/modules/plugins2.0/RP/rpOrder.js on lines 296..304

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

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

    mod.inc = function(btn, amt) {
        var elem = $(btn).parent().find('input.orderAmt');
        var next = ($(elem).val() * 1) + amt;
        if (next < 0) {
            next = 0;
Severity: Major
Found in fannie/modules/plugins2.0/RP/rpFloral.js and 3 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/RP/rpDirect.js on lines 336..344
fannie/modules/plugins2.0/RP/rpDual.js on lines 328..336
fannie/modules/plugins2.0/RP/rpOrder.js on lines 296..304

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

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

    mod.showSourcing = function() {
        $('.upc').show();
        $('.sku').show();
        $('.vendor').show();
        $('.trash').show();
Severity: Major
Found in fannie/modules/plugins2.0/DeliInventory/di.js and 1 other location - About 3 hrs to fix
fannie/modules/plugins2.0/DeliInventory/di.js on lines 253..260

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

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

    mod.hideSourcing = function() {
        $('.upc').hide();
        $('.sku').hide();
        $('.vendor').hide();
        $('.trash').hide();
Severity: Major
Found in fannie/modules/plugins2.0/DeliInventory/di.js and 1 other location - About 3 hrs to fix
fannie/modules/plugins2.0/DeliInventory/di.js on lines 244..251

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

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

                if ($roundvaca[1] < 13) {$roundvaca[1] = 00;}
                elseif ($roundvaca[1] >= 13 && $roundvaca[1] < 37) {$roundvaca[1] = 25;}
                elseif ($roundvaca[1] >= 37 && $roundvaca[1] < 63) {$roundvaca[1] = 50;}
                elseif ($roundvaca[1] >= 63 && $roundvaca[1] < 87) {$roundvaca[1] = 75;}
                elseif ($roundvaca[1] >= 87) {$roundvaca[1] = 00; $roundvaca[0]++;}
Severity: Major
Found in fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/TimesheetPlugin/PayrollDetail.php on lines 100..104
fannie/modules/plugins2.0/TimesheetPlugin/PayrollSummaryPage.php on lines 211..215
fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php on lines 226..230
fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminView.php on lines 362..366

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

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

        if ($roundhour[1] < 13) {$roundhour[1] = 00;}
        elseif ($roundhour[1] >= 13 && $roundhour[1] < 37) {$roundhour[1] = 25;}
        elseif ($roundhour[1] >= 37 && $roundhour[1] < 63) {$roundhour[1] = 50;}
        elseif ($roundhour[1] >= 63 && $roundhour[1] < 87) {$roundhour[1] = 75;}
        elseif ($roundhour[1] >= 87) {$roundhour[1] = 00; $roundhour[0]++;}
fannie/modules/plugins2.0/TimesheetPlugin/PayrollDetail.php on lines 100..104
fannie/modules/plugins2.0/TimesheetPlugin/PayrollSummaryPage.php on lines 211..215
fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php on lines 50..54
fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php on lines 226..230

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

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

        if ($roundhour[1] < 13) {$roundhour[1] = 00;}
        elseif ($roundhour[1] >= 13 && $roundhour[1] < 37) {$roundhour[1] = 25;}
        elseif ($roundhour[1] >= 37 && $roundhour[1] < 63) {$roundhour[1] = 50;}
        elseif ($roundhour[1] >= 63 && $roundhour[1] < 87) {$roundhour[1] = 75;}
        elseif ($roundhour[1] >= 87) {$roundhour[1] = 00; $roundhour[0]++;}
Severity: Major
Found in fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/TimesheetPlugin/PayrollDetail.php on lines 100..104
fannie/modules/plugins2.0/TimesheetPlugin/PayrollSummaryPage.php on lines 211..215
fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php on lines 50..54
fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminView.php on lines 362..366

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

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

                if ($roundhour[1] < 13) {$roundhour[1] = 00;}
                elseif ($roundhour[1] >= 13 && $roundhour[1] < 37) {$roundhour[1] = 25;}
                elseif ($roundhour[1] >= 37 && $roundhour[1] < 63) {$roundhour[1] = 50;}
                elseif ($roundhour[1] >= 63 && $roundhour[1] < 87) {$roundhour[1] = 75;}
                elseif ($roundhour[1] >= 87) {$roundhour[1] = 00; $roundhour[0]++;}
Severity: Major
Found in fannie/modules/plugins2.0/TimesheetPlugin/PayrollDetail.php and 4 other locations - About 3 hrs to fix
fannie/modules/plugins2.0/TimesheetPlugin/PayrollSummaryPage.php on lines 211..215
fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php on lines 50..54
fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php on lines 226..230
fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminView.php on lines 362..366

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

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

Severity
Category
Status
Source
Language