CORE-POS/IS4C

View on GitHub

Showing 1,963 of 8,684 total issues

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

function resumInputs(rowname){
    var sum = 0;

    $('.denom').each(function(){
        denom = $(this).val();
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js and 4 other locations - About 4 hrs to fix
fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 196..208
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 157..169
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 171..181
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 174..184

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

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

function resumInputs(rowname){
    var sum = 0;

    $('.denom').each(function(){
        denom = $(this).val();
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 4 other locations - About 4 hrs to fix
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 157..169
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 171..181
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 160..172
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 174..184

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

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

function resumRow(rowname){
    var sum = 0;
    $('.denom').each(function(){
        denom = $(this).val();
        var elem = document.getElementById(rowname+denom);
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/js/countV2.js and 4 other locations - About 4 hrs to fix
fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 196..208
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 157..169
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 160..172
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 174..184

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

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

function resumRow(rowname){
    var sum = 0;
    $('.denom').each(function(){
        denom = $(this).val();
        var elem = document.getElementById(rowname+denom);
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js and 4 other locations - About 4 hrs to fix
fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 196..208
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 157..169
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 171..181
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 160..172

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

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

    public function get_id_view()
    {
        $table = $this->getTable();
        $td = $table;
        $superID = FormLib::get('super', -1);
Severity: Major
Found in fannie/batches/UNFI/VPBPIV.php and 1 other location - About 4 hrs to fix
fannie/batches/UNFI/VPBPV.php on lines 220..441

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

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

    while($row = $dbc->fetch_row($costsR)){
        if ($curSuper != $row[3]){
            $curSuper = $row[3];
        }
        if (!isset($supers[$curSuper]))
fannie/reports/Store-Specific/WEFC_Toronto/OntarioTaxes/index.php on lines 144..154

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

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

    public function get_id_view()
    {
        $table = $this->getTable();
        $td = $table;
        $superID = FormLib::get('super', -1);
Severity: Major
Found in fannie/batches/UNFI/VPBPV.php and 1 other location - About 4 hrs to fix
fannie/batches/UNFI/VPBPIV.php on lines 213..434

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

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

    while($row = $dbc->fetch_row($salesR)){
        if ($curSuper != $row[3]){
            $curSuper = $row[3];
        }
        if (!isset($supers[$curSuper]))
fannie/reports/Store-Specific/WEFC_Toronto/GeneralCosts/index.php on lines 175..185

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

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

function manyResultForm(data){
    var selectText = '<select onchange="showResultForm(this.value);">';
    var divs = '';
    for(var i=0; i<data.length;i++){
        selectText += '<option value="'+i+'">';
Severity: Major
Found in fannie/purchasing/js/editmany.js and 1 other location - About 4 hrs to fix
fannie/purchasing/js/editone.js on lines 45..56

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

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

function manyResultForm(data){
    var selectText = '<select onchange="showResultForm(this.value);">';
    var divs = '';
    for(var i=0; i<data.length;i++){
        selectText += '<option value="'+i+'">';
Severity: Major
Found in fannie/purchasing/js/editone.js and 1 other location - About 4 hrs to fix
fannie/purchasing/js/editmany.js on lines 55..66

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

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

function updateChangeOrder(d){
    var newval = Number(document.getElementById('changeOrder'+d).value);
    
    var v = Number(document.getElementById('safeCount1'+d).value) + newval;
    document.getElementById('cashInTills'+d).innerHTML = Math.round(v*100)/100;
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/js/countV2.js and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 110..121

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

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

function updateChangeOrder(d){
    var newval = Number(document.getElementById('changeOrder'+d).value);
    
    var v = Number(document.getElementById('safeCount1'+d).value) + newval;
    document.getElementById('cashInTills'+d).innerHTML = Math.round(v*100)/100;
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 107..118

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

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 (is_array(FormLib::get('departments')) && count(FormLib::get('departments')) > 0) {
                        $query .= ' AND t.department IN (';
                        foreach (FormLib::get('departments') as $d) {
                            $query .= '?,';
                            $args[] = $d;
Severity: Major
Found in fannie/classlib2.0/lib/FormLib.php and 1 other location - About 4 hrs to fix
fannie/classlib2.0/lib/FormLib.php on lines 753..764

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

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 (is_array(FormLib::get('departments')) && count(FormLib::get('departments')) > 0) {
                        $query .= ' AND t.department IN (';
                        foreach (FormLib::get('departments') as $d) {
                            $query .= '?,';
                            $args[] = $d;
Severity: Major
Found in fannie/classlib2.0/lib/FormLib.php and 1 other location - About 4 hrs to fix
fannie/classlib2.0/lib/FormLib.php on lines 767..778

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

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

function renameCategory(category){
    var curName = document.getElementById('category'+category).innerHTML;
    var clearName =  curName.replace(/_/,' ');
    var form = "<input type=text id=renameCategory"+category+" value=\""+clearName+"\" />";
    var link = " (<a href=\"\" onclick=\"saveCategory('"+category+"'); return false;\">Save</a>)";
Severity: Major
Found in fannie/modules/plugins2.0/DeliInventory/index3.js and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/DeliInventory/index.js on lines 126..133

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

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

function renameCategory(category){
    var curName = document.getElementById('category'+category).innerHTML;
    var clearName =  curName.replace(/_/,' ');
    var form = "<input type=text id=renameCategory"+category+" value=\""+clearName+"\" />";
    var link = " (<a href=\"\" onclick=\"saveCategory('"+category+"'); return false;\">Save</a>)";
Severity: Major
Found in fannie/modules/plugins2.0/DeliInventory/index.js and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/DeliInventory/index3.js on lines 126..133

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

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 ($dtax > 0) {
            $fix1P = $this->connection->prepare("UPDATE " . FannieDB::fqn('dlog_15', 'trans') . "
                SET regPrice=?
                WHERE tdate BETWEEN ? AND ?
                    AND emp_no=?
Severity: Major
Found in fannie/modules/plugins2.0/Mercato/MercatoCorrections2.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/Mercato/MercatoCorrections2.php on lines 106..143

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

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 ($rtax > 0) {
            $fix1P = $this->connection->prepare("UPDATE " . FannieDB::fqn('dlog_15', 'trans') . "
                SET regPrice=?
                WHERE tdate BETWEEN ? AND ?
                    AND emp_no=?
Severity: Major
Found in fannie/modules/plugins2.0/Mercato/MercatoCorrections2.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/Mercato/MercatoCorrections2.php on lines 145..184

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

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

    protected function get_print_view()
    {
        $catP = $this->connection->prepare("SELECT name FROM DeliCategories WHERE deliCategoryID=?");
        $name = $this->connection->getValue($catP, array($this->print));
        $itemP = $this->connection->prepare("SELECT i.*, v.vendorName
Severity: Major
Found in fannie/modules/plugins2.0/DeliInventory/DIPage2.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/DeliInventory/DIPage.php on lines 281..322

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

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

    protected function get_print_view()
    {
        $catP = $this->connection->prepare("SELECT name FROM DeliCategories WHERE deliCategoryID=?");
        $name = $this->connection->getValue($catP, array($this->print));
        $itemP = $this->connection->prepare("SELECT i.*, v.vendorName
Severity: Major
Found in fannie/modules/plugins2.0/DeliInventory/DIPage.php and 1 other location - About 4 hrs to fix
fannie/modules/plugins2.0/DeliInventory/DIPage2.php on lines 286..327

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

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