CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function get_id_view()
    {
        global $FANNIE_URL;
        $ret = '';

Severity: Major
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumEmailPage.php - About 2 hrs to fix

    Method definition has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function definition()
        {
            global $FANNIE_TRANS_DB;
    
            /* List of CoopCred paymentDepartment's

      Method drawPDF has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function drawPDF()
          {
              $pdf = $this->createPDF();
              $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
              $basicP = $dbc->prepare("SELECT
      Severity: Major
      Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns16UpP.php - About 2 hrs to fix

        Method preprocess has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function preprocess()
            {
                global $FANNIE_COUNTRY, $FANNIE_MEMBER_MODULES, $FANNIE_OP_DB;
        
                $this->country = (isset($FANNIE_COUNTRY)&&!empty($FANNIE_COUNTRY))?$FANNIE_COUNTRY:"US";
        Severity: Major
        Found in fannie/mem/MemberEditor.php - About 2 hrs to fix

          Method visualSignSelectHTML has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function visualSignSelectHTML()
              {
                  $data = array(
                      // array( file name, shown name, class name )
                      array('LegacyWFCHybrid.png', 'Shelf Tags Hybrid (Standard Shelf Tag)', 'Legacy:WFC Hybrid'),
          Severity: Major
          Found in fannie/classlib2.0/lib/SignsLib.php - About 2 hrs to fix

            Method drawItem has 72 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function drawItem($pdf, $item, $row, $column)
                {
                    $item['description'] = preg_replace("/[^\x01-\x7F]/"," ", $item['description']);
                    $item['description'] = str_replace("  ", " ", $item['description']);
                    $effective_width = $this->width - (2*$this->left);
            Severity: Major
            Found in fannie/classlib2.0/item/signage/Signage2UpP.php - About 2 hrs to fix

              Method get_brandList_view has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function get_brandList_view()
                  {
              
                      global $FANNIE_OP_DB;
                      $dbc = FannieDB::get($FANNIE_OP_DB);
              Severity: Major
              Found in fannie/item/PriceRuleEditor.php - About 2 hrs to fix

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

                    public function process_file($linedata, $indexes)
                    {
                        global $FANNIE_OP_DB;
                        $dbc = FannieDB::get($FANNIE_OP_DB);
                
                
                Severity: Major
                Found in fannie/item/import/ProductImportPage.php - About 2 hrs to fix

                  Method ProcessUdpMessage has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private void ProcessUdpMessage(string msg)
                      { 
                          // optional predicate for "termSig" message
                          // predicate string is displayed on sig capture screen
                          if (msg.Length > 7 && msg.Substring(0, 7) == "termSig") {
                  Severity: Major
                  Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_Gen2.cs - About 2 hrs to fix

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

                    function cellify($data,$formatting){
                        $ALIGN_RIGHT = 1;
                        $ALIGN_LEFT = 2;
                        $ALIGN_CENTER = 4;
                        $TYPE_MONEY = 8;
                    Severity: Major
                    Found in fannie/reports/Store-Specific/WFC/EOM-Nabs/index.php and 1 other location - About 2 hrs to fix
                    fannie/reports/Store-Specific/WFC/EOM-Nabs/anydate.php on lines 275..291

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

                    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

                                $data[] = array(
                                    $row['upc'],
                                    $row['brand'],
                                    $row['description'],
                                    sprintf('%.2f', $row['qty']),
                    Severity: Major
                    Found in fannie/reports/DepartmentMovement/ReducedMovementReport.php and 1 other location - About 2 hrs to fix
                    fannie/reports/DepartmentMovement/LineItemMovementReport.php on lines 54..64

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

                    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

                    function cellify($data,$formatting){
                        $ALIGN_RIGHT = 1;
                        $ALIGN_LEFT = 2;
                        $ALIGN_CENTER = 4;
                        $TYPE_MONEY = 8;
                    Severity: Major
                    Found in fannie/reports/Store-Specific/WFC/EOM-Nabs/anydate.php and 1 other location - About 2 hrs to fix
                    fannie/reports/Store-Specific/WFC/EOM-Nabs/index.php on lines 309..325

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

                    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

                                $data[] = array(
                                    $row['upc'],
                                    $row['brand'],
                                    $row['description'],
                                    sprintf('%.2f', $row['qty']),
                    Severity: Major
                    Found in fannie/reports/DepartmentMovement/LineItemMovementReport.php and 1 other location - About 2 hrs to fix
                    fannie/reports/DepartmentMovement/ReducedMovementReport.php on lines 136..146

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

                    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

                        private function guessVendor($info)
                        {
                            if (isset($info['alberts']) && !empty($info['alberts'])) {
                                return 292;
                            } elseif (isset($info['cpw']) && !empty($info['cpw'])) {
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/RpImport.php and 1 other location - About 2 hrs to fix
                    fannie/modules/plugins2.0/RP/RpImportCsv.php on lines 380..395

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

                    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

                        private function guessVendor($info)
                        {
                            if (isset($info['alberts']) && !empty($info['alberts'])) {
                                return 292;
                            } elseif (isset($info['cpw']) && !empty($info['cpw'])) {
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/RpImportCsv.php and 1 other location - About 2 hrs to fix
                    fannie/modules/plugins2.0/RP/RpImport.php on lines 375..390

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

                    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

                    <?php
                    /*******************************************************************************
                    
                        Copyright 2013 Whole Foods Co-op
                    
                    
                    fannie/modules/plugins2.0/WfcHoursTracking/models/WfcHtHoursAllTimeModel.php on lines 1..61

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

                    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

                    <?php
                    /*******************************************************************************
                    
                        Copyright 2013 Whole Foods Co-op
                    
                    
                    fannie/modules/plugins2.0/WfcHoursTracking/models/WfcHtHoursYTDModel.php on lines 1..61

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

                    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 (!is_object($sql)) {
                        echo "<span class='fail'>" . _('Failed') . "</span>";
                        echo '<div class="db_hints" style="margin-left:25px;">';
                        if (!function_exists('socket_create')){
                            echo _('<i>Try enabling PHP\'s socket extension in php.ini for better diagnostics</i>');
                    Severity: Major
                    Found in pos/is4c-nf/install/index.php and 1 other location - About 2 hrs to fix
                    pos/is4c-nf/install/index.php on lines 338..362

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

                    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 (!is_object($sql)) {
                        echo "<span class='fail'>" . _('Failed') . "</span>";
                        echo '<div class="db_hints" style="margin-left:25px;width:350px;">';
                        if (!function_exists('socket_create')){
                            echo _('<i>Try enabling PHP\'s socket extension in php.ini for better diagnostics</i>');
                    Severity: Major
                    Found in pos/is4c-nf/install/index.php and 1 other location - About 2 hrs to fix
                    pos/is4c-nf/install/index.php on lines 194..217

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

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

                    <?php
                    /*******************************************************************************
                    
                        Copyright 2013 Whole Foods Co-op
                    
                    
                    Severity: Minor
                    Found in fannie/reports/GeneralRange/GeneralRangeReport.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language