CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

File index.php has 391 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2010 Whole Foods Co-op

Severity: Minor
Found in pos/is4c-nf/install/index.php - About 5 hrs to fix

    File SpecialOrderTags.php has 391 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2010 Whole Foods Co-op
    
    
    Severity: Minor
    Found in fannie/ordering/SpecialOrderTags.php - About 5 hrs to fix

      Method get_view has 134 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function get_view()
          {
              $lib_class = $this->lib_class;
              $dbc = $lib_class::getDB();
      
      
      Severity: Major
      Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfWeekEntryPage.php - About 5 hrs to fix

        Method get_pdf_handler has 134 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function get_pdf_handler()
            {
                $store = FormLib::get('store', COREPOS\Fannie\API\lib\Store::getIdByIp());
        
                $ts = time();
        Severity: Major
        Found in fannie/modules/plugins2.0/RP/RpDailyPage.php - About 5 hrs to fix

          File LikeCodeSKUsPage.php has 390 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          include(dirname(__FILE__) . '/../../config.php');
          if (!class_exists('FannieAPI')) {
              include(__DIR__ . '/../../classlib2.0/FannieAPI.php');
          Severity: Minor
          Found in fannie/item/likecodes/LikeCodeSKUsPage.php - About 5 hrs to fix

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

            function programChange(){
                var pID = $('#programselect').val();
                if (pID == 0){ 
                    $('#infodiv').html("");
                    return;
            fannie/modules/plugins2.0/CoopCred/programs/coopcred_config.js on lines 24..44

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

            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 programChange(){
                var pID = $('#configselect').val();
                if (pID == 0){ 
                    $('#infodiv').html("");
                    return;
            fannie/modules/plugins2.0/CoopCred/programs/coopcred_program.js on lines 24..44

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

            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 deleteFromLanes()
                {
                    // load complete record
                    if (!$this->load()) {
                        return false;
            Severity: Major
            Found in fannie/classlib2.0/data/models/BasicModel.php and 1 other location - About 5 hrs to fix
            fannie/classlib2.0/data/models/BasicModel.php on lines 63..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 190.

            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 pushToLanes()
                {
                    // load complete record
                    if (!$this->load()) {
                        return false;
            Severity: Major
            Found in fannie/classlib2.0/data/models/BasicModel.php and 1 other location - About 5 hrs to fix
            fannie/classlib2.0/data/models/BasicModel.php on lines 93..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 190.

            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 run has 133 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run($args=array())
                {
                    $ret = array();
                    if (!property_exists($args, 'type')) {
                        // missing required arguments
            Severity: Major
            Found in fannie/classlib2.0/webservices/FannieDeptLookup.php - About 5 hrs to fix

              File ScaleItemModule.php has 388 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*******************************************************************************
              
                  Copyright 2013 Whole Foods Co-op, Duluth, MN
              
              
              Severity: Minor
              Found in fannie/item/modules/ScaleItemModule.php - About 5 hrs to fix

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

                        foreach (explode("\n", $text) as $line) {
                            if ($table && strstr($line, '<!-- end of items -->')) {
                                $message .= '</table>' . $line . '<br>';
                                $table = false;
                            } elseif ($table) {
                Severity: Major
                Found in fannie/modules/plugins2.0/EReceipt/EReceiptLib.php and 1 other location - About 5 hrs to fix
                pos/is4c-nf/lib/PrintHandlers/HtmlEmailPrintHandler.php on lines 77..94

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

                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

                            foreach (explode("\n", $text) as $line) {
                                if ($table && strstr($line, '<!-- end of items -->')) {
                                    $message .= '</table>' . $line . '<br>';
                                    $table = false;
                                } elseif ($table) {
                Severity: Major
                Found in pos/is4c-nf/lib/PrintHandlers/HtmlEmailPrintHandler.php and 1 other location - About 5 hrs to fix
                fannie/modules/plugins2.0/EReceipt/EReceiptLib.php on lines 27..44

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

                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 drawPDF()
                    {
                        $pdf = $this->createPDF();
                
                        $data = $this->loadItems();
                Severity: Major
                Found in fannie/classlib2.0/item/signage/Compact12UpL.php and 1 other location - About 5 hrs to fix
                fannie/classlib2.0/item/signage/Signage12UpL.php on lines 165..190

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

                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 drawPDF()
                    {
                        $pdf = $this->createPDF();
                
                        $data = $this->loadItems();
                Severity: Major
                Found in fannie/classlib2.0/item/signage/Signage12UpL.php and 1 other location - About 5 hrs to fix
                fannie/classlib2.0/item/signage/Compact12UpL.php on lines 167..192

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

                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 get_view has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function get_view()
                    {
                        $lib_class = $this->lib_class;
                        $dbc = $lib_class::getDB();
                
                
                Severity: Major
                Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeekEntryPageV2.php - About 5 hrs to fix

                  Method etl has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function etl($config)
                      {
                          $settings = $config->get('PLUGIN_SETTINGS');
                          $mydb = $settings['MyWebDB'] . $this->connection->sep();
                          $opdb = $config->get('OP_DB') . $this->connection->sep();
                  Severity: Major
                  Found in fannie/modules/plugins2.0/MyWeb/models/MyStatsModel.php - About 5 hrs to fix

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

                        function fetch_report_data(){
                            global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
                    
                            $ret = array();
                    
                    

                      Method pushTable has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          static public function pushTable($table,$db='op',
                              $truncate=self::TRUNCATE_DESTINATION,$one_lane=0)
                          {
                              global $FANNIE_OP_DB, $FANNIE_TRANS_DB, $FANNIE_LANES;
                              /* Only if needed.
                      Severity: Major
                      Found in fannie/modules/plugins2.0/CoopCred/sync/SyncLanesForPlugin.php - About 5 hrs to fix

                        Method getScanData has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getScanData()
                            {
                                global $FANNIE_PLUGIN_SETTINGS,$FANNIE_OP_DB;
                                $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['ShelfAuditDB']);
                                $order='dept_no,s.section,s.datetime';
                        Severity: Major
                        Found in fannie/modules/plugins2.0/ShelfAudit/SaReportPage.php - About 5 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language