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

function doTask(str){
    var val;
    switch(str){
    case 'clear':
        ND_hide();
Severity: Major
Found in pos/is4c-nf/js/Numbers.js and 1 other location - About 4 hrs to fix
pos/is4c-nf/js/Letters.js on lines 58..76

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

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

function LD_doTask(str){
    var val;
    switch(str){
    case 'clear':
        LD_hide();
Severity: Major
Found in pos/is4c-nf/js/Letters.js and 1 other location - About 4 hrs to fix
pos/is4c-nf/js/Numbers.js on lines 45..63

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method css_content has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function css_content()
    {
        return <<<HTML
        span.grey {
            color: grey;
Severity: Major
Found in fannie/batches/UNFI/VPBPV.php - About 4 hrs to fix

    File HourlySalesReport.php has 355 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2013 Whole Foods Co-op
    
    
    Severity: Minor
    Found in fannie/reports/HourlySales/HourlySalesReport.php - About 4 hrs to fix

      Method WFC_Narrow has 113 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function WFC_Narrow($data,$offset=0)
      {
          $pdf=new WFC_Narrow_PDF('P','mm','Letter'); //start new instance of PDF
          $pdf->Open(); //open new PDF Document
          $pdf->SetTopMargin(40);  //Set top margin of the page
      Severity: Major
      Found in fannie/admin/labels/pdf_layouts/WFC_Narrow.php - About 4 hrs to fix

        Method body_content has 113 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function body_content()
            {
                $db = WfcHtLib::hours_dbconnect();
        
                $ppID = -1;
        Severity: Major
        Found in fannie/modules/plugins2.0/WfcHoursTracking/WfcHtPayPeriodsPage.php - About 4 hrs to fix

          Method post_id_handler has 113 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function post_id_handler()
              {
                  $store = COREPOS\Fannie\API\lib\Store::getIdByIp();
                  $dbc = $this->connection;
                  $prep = $dbc->prepare("
          Severity: Major
          Found in fannie/modules/plugins2.0/DeliInventory/DIScanner.php - About 4 hrs to fix

            Method run has 113 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run()
                {
                    if (!class_exists('Automattic\WooCommerce\Client')) {
                        $this->cronMsg('Library missing. Use composer to install automattic/woocommerce');
                        return false;
            Severity: Major
            Found in fannie/modules/plugins2.0/WooSync/WooCaseTask.php - About 4 hrs to fix

              Method get_newgc_view has 113 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function get_newgc_view()
                  {
                      $json = FormLib::get('json');
                      $dbc = FannieDB::get($this->config->get('OP_DB'));
              
              
              Severity: Major
              Found in fannie/modules/plugins2.0/GiftCardTracker/GiftCardTracker.php - About 4 hrs to fix

                Method get_start_view has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function get_start_view()
                    {
                        global $FANNIE_OP_DB;
                        $dbc = FannieDB::get($FANNIE_OP_DB);
                
                
                Severity: Major
                Found in fannie/item/ProdLocationEditor.php - About 4 hrs to fix

                  Class NativeMethods has 35 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      unsafe static class NativeMethods
                      {
                          // For constants, see PInvoke.Net,
                          //  http://doxygen.reactos.org/de/d2a/hidclass_8h_source.html
                          //  http://www.rpi.edu/dept/cis/software/g77-mingw32/include/winioctl.h

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

                        case '0.25':
                            count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 10);
                            val = Number(document.getElementById('dropAmount'+d).value) - (10*count);
                            document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                            updateBuyAmount(d);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 288..293
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 294..299
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 300..305

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

                    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

                        case '0.01':
                            count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 0.50);
                            val = Number(document.getElementById('dropAmount'+d).value) - (0.50*count);
                            document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                            updateBuyAmount(d);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 282..287
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 288..293
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 294..299

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

                    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

                        case '0.05':
                            count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 2);
                            val = Number(document.getElementById('dropAmount'+d).value) - (2*count);
                            document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                            updateBuyAmount(d);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 282..287
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 288..293
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 300..305

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

                    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

                        case '0.10':
                            count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 5);
                            val = Number(document.getElementById('dropAmount'+d).value) - (5*count);
                            document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                            updateBuyAmount(d);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 282..287
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 294..299
                    fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 300..305

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

                    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 ScreeningPage.php has 354 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    include(__DIR__ . '/../../../../config.php');
                    if (!class_exists('FannieAPI')) {
                        include(__DIR__ . '/../../../../classlib2.0/FannieAPI.php');
                    Severity: Minor
                    Found in fannie/modules/plugins2.0/HrWeb/Screening/ScreeningPage.php - About 4 hrs to fix

                      Method fetch_report_data has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function fetch_report_data()
                          {
                              /* provide a department range and date range to
                                 get history for all products in those departments
                                 for that time period AND current price
                      Severity: Major
                      Found in fannie/reports/PriceHistory/PriceHistoryReport.php - About 4 hrs to fix

                        Method body_content has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function body_content()
                            {
                                global $FANNIE_OP_DB, $FANNIE_URL;
                                ob_start();
                                $dbc = FannieDB::get($FANNIE_OP_DB);

                          Method process_file has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function process_file($linedata, $indexes)
                              {
                                  global $FANNIE_OP_DB;
                                  $PHONE = $this->get_column_index('phone');
                                  $CONTACT = $this->get_column_index('name');
                          Severity: Major
                          Found in fannie/modules/plugins2.0/WfcGazetteBilling/WfcGazetteBillingPage.php - About 4 hrs to fix

                            Method run has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function run()
                                {
                                    if (!class_exists('Automattic\WooCommerce\Client')) {
                                        $this->cronMsg('Library missing. Use composer to install automattic/woocommerce');
                                        return false;
                            Severity: Major
                            Found in fannie/modules/plugins2.0/WooSync/WooPullTransTask.php - About 4 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language