CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method prefsView has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function prefsView($calID,$uid)
    {
        global $FANNIE_OP_DB;
        if (!CalendarPluginPermissions::is_owner($uid,$calID)){
            return "<h2>Either something goofed up or you aren't allowed to change
Severity: Major
Found in fannie/modules/plugins2.0/CalendarPlugin/CalendarPluginDisplayLib.php - About 3 hrs to fix

    Method b2bHandler has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function b2bHandler($dbc, $ids)
        {
            $ids = array_map(function($i) { return str_replace('b2b', '', $i); }, $ids);
            $invP = $dbc->prepare('SELECT * FROM ' . $this->config->get('TRANS_DB') . $dbc->sep() . 'B2BInvoices WHERE b2bInvoiceID=?');
            foreach ($ids as $id) {
    Severity: Major
    Found in fannie/modules/plugins2.0/StatementsPlugin/StatementsPluginEmail.php - About 3 hrs to fix

      Method refresh_data has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function refresh_data($trans_db, $month, $year, $day=False)
          {
              list($start_id, $start_date, $end_id, $end_date) = $this->dates($month, $year, $day);
      
              // if it's currently Monday and called for today, go back a week
      Severity: Major
      Found in fannie/modules/plugins2.0/CoreWarehouse/models/WfcTopWeeksModel.php - About 3 hrs to fix

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

            public function run()
            {
                $settings = $this->config->PLUGIN_SETTINGS;
                $dbc = FannieDB::get($settings['TargetedPromosDB']);
                $warehouse = $settings['WarehouseDatabase'];
        Severity: Major
        Found in fannie/modules/plugins2.0/TargetedPromos/tasks/DefectorTargetTask.php - About 3 hrs to fix

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

              protected function get_view()
              {
                  $this->addScript('../../../src/javascript/chosen/chosen.jquery.min.js');
                  $this->addCssFile('../../../src/javascript/chosen/bootstrap-chosen.css');
                  $this->addOnloadCommand("\$('select.chosen').chosen();");
          Severity: Major
          Found in fannie/modules/plugins2.0/RP/RpPreBookPage.php - About 3 hrs to fix

            Method getCustdata has 83 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function getCustdata($dbc, $id)
                {
                    if ($id == 0) {
                        return self::getAllCustdata($dbc);
                    }
            Severity: Major
            Found in fannie/classlib2.0/member/MemberREST.php - About 3 hrs to fix

              Method get_id_view has 83 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function get_id_view()
                  {
                      $upc = BarcodeLib::padUPC($this->id);
                      $infoP = $this->connection->prepare('SELECT p.brand, p.description,
                          u.brand AS uBrand, u.description AS uDesc, u.photo
              Severity: Major
              Found in fannie/item/mapping/FindItem.php - About 3 hrs to fix

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

                    function body_content(){
                        global $FANNIE_OP_DB;
                        $dbc = FannieDB::get($FANNIE_OP_DB);
                        $opts = "";
                        $p = $dbc->prepare("SELECT likeCode,likeCodeDesc FROM likeCodes ORDER BY likeCode");
                Severity: Major
                Found in fannie/item/likecodes/LikeCodeEditor.php - About 3 hrs to fix

                  Method ParsePath has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private bool ParsePath(List<PathFilter> filters, int currentPartStartIndex, bool query)
                          {
                              bool scan = false;
                              bool followingIndexer = false;
                              bool followingDot = false;

                    Method GenerateCreateMethodCallIL has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            private void GenerateCreateMethodCallIL(MethodBase method, ILGenerator generator, int argsIndex)
                            {
                                ParameterInfo[] args = method.GetParameters();
                    
                                Label argsOk = generator.DefineLabel();

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

                          private function refnum($emp, $reg, $trans, $id)
                          {
                              $ref = "";
                              $ref .= date("md");
                              $ref .= str_pad($emp, 4, "0", STR_PAD_LEFT);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php and 3 other locations - About 3 hrs to fix
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php on lines 57..66
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixVoid.php on lines 42..51
                      fannie/modules/plugins2.0/RecurringEquity/EqRecurTask.php on lines 314..323

                      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

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

                          private function refnum($emp, $reg, $trans, $id)
                          {
                              $ref = "";
                              $ref .= date("md");
                              $ref .= str_pad($emp, 4, "0", STR_PAD_LEFT);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RecurringEquity/EqRecurTask.php and 3 other locations - About 3 hrs to fix
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php on lines 57..66
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php on lines 57..66
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixVoid.php on lines 42..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 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

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

                      foreach(array_keys($transinfo) as $k){
                          $transinfo[$k][2] = round($transinfo[$k][1]/$transinfo[$k][0],2);
                          $transinfo[$k][4] = round($transinfo[$k][3]/$transinfo[$k][0],2);
                          $tSum += $transinfo[$k][0];
                          $tItems += $transinfo[$k][1];
                      Severity: Major
                      Found in fannie/reports/Store-Specific/WFC/DailyReport/index.php and 1 other location - About 3 hrs to fix
                      fannie/reports/GeneralDay/GeneralDayReport.php on lines 284..290

                      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

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

                          private function refnum($emp, $reg, $trans, $id)
                          {
                              $ref = "";
                              $ref .= date("md");
                              $ref .= str_pad($emp, 4, "0", STR_PAD_LEFT);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixVoid.php and 3 other locations - About 3 hrs to fix
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php on lines 57..66
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php on lines 57..66
                      fannie/modules/plugins2.0/RecurringEquity/EqRecurTask.php on lines 314..323

                      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

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

                          private function refnum($emp, $reg, $trans, $id)
                          {
                              $ref = "";
                              $ref .= date("md");
                              $ref .= str_pad($emp, 4, "0", STR_PAD_LEFT);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php and 3 other locations - About 3 hrs to fix
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php on lines 57..66
                      fannie/modules/plugins2.0/PaycardFix/PaycardFixVoid.php on lines 42..51
                      fannie/modules/plugins2.0/RecurringEquity/EqRecurTask.php on lines 314..323

                      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

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

                          protected function delete_id_handler()
                          {
                              // forcing sequential requests here
                              $_SESSION['appendingOrder'] = true;
                      
                      
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RP/RpDualPage.php and 1 other location - About 3 hrs to fix
                      fannie/modules/plugins2.0/RP/RpOrderPage.php on lines 235..252

                      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

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

                              foreach (array_keys($transinfo) as $k) {
                                  $transinfo[$k][2] = round($transinfo[$k][1]/$transinfo[$k][0],2);
                                  $transinfo[$k][4] = round($transinfo[$k][3]/$transinfo[$k][0],2);
                                  $tSum += $transinfo[$k][0];
                                  $tItems += $transinfo[$k][1];
                      Severity: Major
                      Found in fannie/reports/GeneralDay/GeneralDayReport.php and 1 other location - About 3 hrs to fix
                      fannie/reports/Store-Specific/WFC/DailyReport/index.php on lines 393..399

                      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

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

                          protected function delete_id_handler()
                          {
                              // forcing sequential requests here
                              $_SESSION['appendingOrder'] = true;
                      
                      
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RP/RpOrderPage.php and 1 other location - About 3 hrs to fix
                      fannie/modules/plugins2.0/RP/RpDualPage.php on lines 234..251

                      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 3 locations. Consider refactoring.
                      Open

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2014 Whole Foods Co-op
                      
                      
                      fannie/classlib2.0/data/models/op/ProdCostHistoryModel.php on lines 1..51
                      fannie/classlib2.0/data/models/op/ProdPriceHistoryModel.php on lines 1..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 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 3 locations. Consider refactoring.
                      Open

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2015 Whole Foods Co-op
                      
                      
                      Severity: Major
                      Found in fannie/classlib2.0/data/models/op/ProdCostHistoryModel.php and 2 other locations - About 3 hrs to fix
                      fannie/classlib2.0/data/models/op/ProdDepartmentHistoryModel.php on lines 1..55
                      fannie/classlib2.0/data/models/op/ProdPriceHistoryModel.php on lines 1..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 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

                      Severity
                      Category
                      Status
                      Source
                      Language