CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

        public override JToken this[object key]
        {
            get
            {
                ValidationUtils.ArgumentNotNull(key, "o");
pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Linq/JArray.cs on lines 205..225

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

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 override JToken this[object key]
        {
            get
            {
                ValidationUtils.ArgumentNotNull(key, "o");
pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Linq/JConstructor.cs on lines 162..182

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

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 ($i == 0) {
            $pdf = generateChefTag($x, $y, $guide, $width*2, $height*3, $pdf, $row, $dbc);
        } else if ($i % 2 == 0 && $i != 0) {
            $x = $left*2+$guide -3;
            $y += $height*3+$guide;
Severity: Major
Found in fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php and 1 other location - About 2 hrs to fix
fannie/admin/labels/pdf_layouts/Soup_Signs_4UP.php on lines 60..67

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

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

    protected function post_dept_handler()
    {
        $plugin = $this->config->get('PLUGIN_SETTINGS');
        $table = $plugin['InstaCartDB'] . $this->connection->sep() . 'InstaDepts';
        $prep = $this->connection->prepare("SELECT instaDeptID FROM {$table} WHERE instaDeptID=?");
Severity: Major
Found in fannie/modules/plugins2.0/InstaCart/InstaInExPage.php and 2 other locations - About 2 hrs to fix
fannie/modules/plugins2.0/InstaCart/InstaInExPage.php on lines 34..45
fannie/modules/plugins2.0/InstaCart/InstaInExPage.php on lines 80..91

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

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 ($i == 0) {
            $pdf = generateSoupTag($x, $y, $guide, $width*2, $height*3, $pdf, $row, $dbc);
        } else if ($i % 2 == 0 && $i != 0) {
            $x = $left*2+$guide -3;
            $y += $height*3+$guide;
Severity: Major
Found in fannie/admin/labels/pdf_layouts/Soup_Signs_4UP.php and 1 other location - About 2 hrs to fix
fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php on lines 45..52

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

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

    protected function post_super_handler()
    {
        $plugin = $this->config->get('PLUGIN_SETTINGS');
        $table = $plugin['InstaCartDB'] . $this->connection->sep() . 'InstaSupers';
        $prep = $this->connection->prepare("SELECT instaSuperID FROM {$table} WHERE instaSuperID=?");
Severity: Major
Found in fannie/modules/plugins2.0/InstaCart/InstaInExPage.php and 2 other locations - About 2 hrs to fix
fannie/modules/plugins2.0/InstaCart/InstaInExPage.php on lines 57..68
fannie/modules/plugins2.0/InstaCart/InstaInExPage.php on lines 80..91

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

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

    protected function post_sub_handler()
    {
        $plugin = $this->config->get('PLUGIN_SETTINGS');
        $table = $plugin['InstaCartDB'] . $this->connection->sep() . 'InstaSubs';
        $prep = $this->connection->prepare("SELECT instaSubID FROM {$table} WHERE instaSubID=?");
Severity: Major
Found in fannie/modules/plugins2.0/InstaCart/InstaInExPage.php and 2 other locations - About 2 hrs to fix
fannie/modules/plugins2.0/InstaCart/InstaInExPage.php on lines 34..45
fannie/modules/plugins2.0/InstaCart/InstaInExPage.php on lines 57..68

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

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 = $this->connection->fetchRow($res)) {
            $date = date('Y-m-d', mktime(0,0,0,$row['month'],$row['day'],$row['year']));
            $data[] = array(
                $date,
                $row['transType'],
Severity: Major
Found in fannie/reports/Accounting/ArByDay.php and 1 other location - About 2 hrs to fix
fannie/reports/Accounting/TenderByDay.php on lines 86..95

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

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

        $data[] = array(
            'Hours',
            '',
            number_format($total_hours->projected, 0),
            '',
fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 677..691

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

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

        $data[] = array(
            'Wages',
            '',
            number_format($total_wages->projected, 0),
            '',
fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 661..675

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

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 = $this->connection->fetchRow($res)) {
            $date = date('Y-m-d', mktime(0,0,0,$row['month'],$row['day'],$row['year']));
            $data[] = array(
                $date,
                $row['TenderName'],
Severity: Major
Found in fannie/reports/Accounting/TenderByDay.php and 1 other location - About 2 hrs to fix
fannie/reports/Accounting/ArByDay.php on lines 92..101

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

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

File di.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var di = (function ($) {
    var mod = {};

    var openInput = false;
    var openVendor = false;
Severity: Minor
Found in fannie/modules/plugins2.0/DeliInventory/di.js - About 2 hrs to fix

    File AuthorizeDotNet.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2007,2010 Whole Foods Co-op
    
    
    Severity: Minor
    Found in pos/is4c-nf/plugins/Paycards/AuthorizeDotNet.php - About 2 hrs to fix

      File DeptLib.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2016 Whole Foods Co-op
      
      
      Severity: Minor
      Found in pos/is4c-nf/lib/DeptLib.php - About 2 hrs to fix

        File EquityHistoryTask.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2013 Whole Foods Co-op
        
        
        Severity: Minor
        Found in fannie/cron/tasks/EquityHistoryTask.php - About 2 hrs to fix

          File anydate.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          use COREPOS\Fannie\API\item\StandardAccounting;
          if (basename(__FILE__) != basename($_SERVER['PHP_SELF'])) {
              return;
          }
          Severity: Minor
          Found in fannie/reports/Store-Specific/WFC/EOM-Nabs/anydate.php - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                if ( $rowCount1 == 0 && $rowCount2 == 0) {
                    $localCheck .= "\n\nThe shift was ended properly, buffers empty. " .
                        "Good!";
            
                    }
            Severity: Critical
            Found in pos/is4c-nf/lib/ReceiptBuilding/TenderReports/WefcTorontoTenderReport.php - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                          if ($row['special_price'] != 0 && $row['special_price'] < $row['normal_price'] && $row['datedSigns'] && $row['specialpricemethod'] == 0 && $row['discounttype'] == 1 && $this->dbc->getValue($saleP, array($row['upc']))) {
                              fprintf($csv, '%.2f%s', $row['special_price'], $sep);
                              fwrite($csv, date('m/d/Y', strtotime($row['start_date'])) . $sep);
                              $ts = strtotime($row['end_date']);
                              $next = mktime(0,0,0, date('n',$ts), date('j',$ts)+1, date('Y', $ts));
              Severity: Critical
              Found in fannie/modules/plugins2.0/InstaCart/InstaFileV3.php - About 2 hrs to fix

                Class XmlNodeConverter has 22 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    public class XmlNodeConverter : JsonConverter
                    {
                        private const string TextName = "#text";
                        private const string CommentName = "#comment";
                        private const string CDataName = "#cdata-section";

                  Class ConvertUtils has 22 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      internal static class ConvertUtils
                      {
                          private static readonly Dictionary<Type, PrimitiveTypeCode> TypeCodeMap =
                              new Dictionary<Type, PrimitiveTypeCode>
                              {
                    Severity
                    Category
                    Status
                    Source
                    Language