CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

<?php
/*******************************************************************************

    Copyright 2014 Whole Foods Co-op

Severity: Major
Found in fannie/classlib2.0/data/models/op/ProdPriceHistoryModel.php and 2 other locations - About 3 hrs to fix
fannie/classlib2.0/data/models/op/ProdCostHistoryModel.php on lines 1..51
fannie/classlib2.0/data/models/op/ProdDepartmentHistoryModel.php on lines 1..55

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

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(
            'Other Personnel Cost (est)',
            '',
            number_format($total_wages->projected * $p_est, 0),
            '',
fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 727..741

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

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(
            'Total Personnel Cost (est)',
            '',
            number_format($total_wages->projected * $p_est, 0),
            '',
fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 710..724

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

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

<?php
/*******************************************************************************

    Copyright 2010,2013 Whole Foods Co-op

Severity: Minor
Found in fannie/batches/UNFI/RecalculateVendorSRPs.php - About 3 hrs to fix

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

        function process_file($linedata, $indexes)
        {
            global $FANNIE_OP_DB;
            $dbc = FannieDB::get($FANNIE_OP_DB);
            $VENDOR_ID = $this->getVendorID();
    Severity: Major
    Found in fannie/batches/UNFI/load-classes/FalkUploadPage.php - About 3 hrs to fix

      Method form_content has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function form_content()
          {
              $sql = $this->connection;
              $sql->selectDB($this->config->get('OP_DB'));
      
      
      Severity: Major
      Found in fannie/reports/CostHistory/CostHistoryReport.php - About 3 hrs to fix

        Method form_content has 82 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function form_content()
            {
                $sql = $this->connection;
                $sql->selectDB($this->config->get('OP_DB'));
        
        
        Severity: Major
        Found in fannie/reports/PriceHistory/PriceHistoryReport.php - About 3 hrs to fix

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

              public function fetch_report_data()
              {        
                  $count = 0;
                  $item = array();       
                  $upc = array();
          Severity: Major
          Found in fannie/reports/PriceReduction/PriceReduction.php - About 3 hrs to fix

            Method processMail has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function processMail($msg)
                {
                    $info = $this->parseEmail($msg);
                    $boundary = $this->hasAttachments($info['headers']);
                    $dbc = \FannieDB::get(\FannieConfig::config('OP_DB'));
            Severity: Major
            Found in fannie/modules/plugins2.0/AlbertsInvoiceImport/AiiDeliMailPipe.php - About 3 hrs to fix

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

                  function fetch_report_data()
                  {
                      $dbc = $this->connection;
                      $dbc->selectDB($this->config->get('OP_DB'));
              
              
              Severity: Major
              Found in fannie/purchasing/reports/OutOfStockReport.php - About 3 hrs to fix

                Method javascript_content has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function javascript_content()
                    {
                        ob_start();
                        ?>
                        function saveMem(st,t_id){
                Severity: Major
                Found in fannie/mem/MemberTypeEditor.php - About 3 hrs to fix

                  Method javascriptContent has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function javascriptContent()
                      {
                          return <<<JAVASCRIPT
                  var saved = false;
                  
                  
                  Severity: Major
                  Found in fannie/item/PriceRuleEditor.php - About 3 hrs to fix

                    Method SaveFormData has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function SaveFormData($upc)
                        {
                            $upc = BarcodeLib::padUPC($upc);
                            $brand = FormLib::get('lf_brand');
                            $desc = FormLib::get('lf_desc');
                    Severity: Major
                    Found in fannie/item/modules/ProdUserModule.php - About 3 hrs to fix

                      Method form_content has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function form_content()
                          {
                              global $FANNIE_OP_DB;
                              $dbc = FannieDB::get($FANNIE_OP_DB);
                      
                      
                      Severity: Major
                      Found in fannie/item/ProductListPage.php - About 3 hrs to fix

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

                                if ($this->connection->tableExists("$source")) {
                                    $dQuery = "SELECT paymentDepartment
                                        FROM $source
                                        WHERE paymentDepartment != 0";
                                    $dResults = $this->connection->query($dQuery);
                        fannie/modules/plugins2.0/CoopCred/models/vmodels/CCredHistoryTodaySumModel.php on lines 57..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 147.

                        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 ($this->connection->tableExists("$source")) {
                                    $dQuery = "SELECT paymentDepartment
                                        FROM $source
                                        WHERE paymentDepartment != 0";
                                    $dResults = $this->connection->query($dQuery);
                        fannie/modules/plugins2.0/CoopCred/models/vmodels/CCredHistoryTodayModel.php on lines 58..77

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

                        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 readinessCheck()
                            {
                                $dbc = $this->connection;
                                $dbc->selectDB($this->config->get('ARCHIVE_DB'));
                                if ($this->tableExistsReadinessCheck($this->config->get('ARCHIVE_DB'), 'productWeeklyLastQuarter') === false) {
                        Severity: Major
                        Found in fannie/reports/ItemLastQuarter/ItemLastQuarterReport.php and 1 other location - About 3 hrs to fix
                        fannie/reports/ItemOrderHistory/ItemOrderHistoryReport.php on lines 157..174

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

                        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 (isset($dots[$upc]) && $dots[$upc] == 'PRODUCE') {
                                    $pdf->SetFillColor(0, 255, 100); // green 
                                    $pdf->Circle($full_x+48.0, $full_y+9.5, 1.25, 'F');
                                    $pdf->SetFillColor(255,255,255);
                                    $pdf->SetTextColor(255,255,255);
                        Severity: Major
                        Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php and 1 other location - About 3 hrs to fix
                        fannie/admin/labels/pdf_layouts/WFC_Hybrid.php on lines 286..294

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

                        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

                            protected function get_id_handler()
                            {
                                global $FANNIE_TRANS_DB;
                                $this->card_no = $this->id;
                        
                        
                        Severity: Major
                        Found in fannie/modules/plugins2.0/PIKiller/PIArPage.php and 1 other location - About 3 hrs to fix
                        fannie/modules/plugins2.0/PIKiller/PIB2BListPage.php on lines 34..51

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

                        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 (isset($dots[$upc]) && $dots[$upc] == 'PRODUCE') {
                                    $pdf->SetFillColor(0, 255, 100); // green 
                                    $pdf->Circle($full_x+48.5, $full_y+9.5, 1.25, 'F');
                                    $pdf->SetFillColor(255,255,255);
                                    $pdf->SetTextColor(255,255,255);
                        Severity: Major
                        Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid.php and 1 other location - About 3 hrs to fix
                        fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php on lines 273..281

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

                        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