CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method generateBulk_Repack_24UPTag has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function generateBulk_Repack_24UPTag($x, $y, $guide, $width, $height, $pdf, $row, $dbc, $showPrice, $offset, $tagNo)
{
    $upc = $row['upc'];
    $sku = $row['sku'];
    $brand = strToUpper($row['brand']);
Severity: Major
Found in fannie/admin/labels/pdf_layouts/WFC_Bulk_Repack_14UP.php - About 3 hrs to fix

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

        public function get_id_view()
        {
            $dbc = $this->connection;
            $settings = $this->config->get('PLUGIN_SETTINGS');
            $dbc->selectDB($settings['TimesheetDatabase']);
    Severity: Major
    Found in fannie/modules/plugins2.0/TimesheetPlugin/admin/TsEmployeesEditor.php - About 3 hrs to fix

      Method updateVendors has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function updateVendors($data)
          {
              $vendLC = new VendorLikeCodeMapModel($this->connection);
              $activeP = $this->connection->prepare("SELECT storeID FROM LikeCodeActiveMap WHERE inUse=1 AND likeCode=?");
              $catP = $this->connection->prepare("
      Severity: Major
      Found in fannie/modules/plugins2.0/RP/RpImportCsv.php - About 3 hrs to fix

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

            public function javascriptContent()
            {
                $dbc = FannieDB::get($this->config->get('OP_DB'));
                $prep = $dbc->prepare("SELECT label FROM houseCoupons GROUP BY label");
                $res = $dbc->execute($prep);
        Severity: Major
        Found in fannie/modules/plugins2.0/HouseCoupon/HouseCouponEditor.php - About 3 hrs to fix

          Method get_vendors_date1_date2_view has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function get_vendors_date1_date2_view()
              {
                  $dbc = $this->connection;
                  $dbc->setDefaultDB($this->config->get('OP_DB'));
          
          
          Severity: Major
          Found in fannie/purchasing/InvoiceCostCompare.php - About 3 hrs to fix

            Method showEditForm has 92 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function showEditForm($upc, $display_mode=1, $expand_mode=1)
                {
                    $FANNIE_CSS_PRIMARY_COLOR = FannieConfig::config('CSS_PRIMARY_COLOR');
                    $upc = BarcodeLib::padUPC($upc);
            
            
            Severity: Major
            Found in fannie/item/modules/VendorItemModule.php - About 3 hrs to fix

              Method WriteTokenInternal has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      private void WriteTokenInternal(JsonToken tokenType, object value)
                      {
                          switch (tokenType)
                          {
                              case JsonToken.None:

                Method PinpadGetPIN has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected byte[] PinpadGetPIN(){
                        byte[] ret = new byte[112];
                        int pos = 0;
                
                        // Command head
                Severity: Major
                Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 3 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if ($row['trans_status'] == 'V' || $row['trans_type'] == 'T' || $row['trans_status'] == 'R' || $row['trans_status'] == 'M' || $row['voided'] == 17 || $row['trans_status'] == 'J') {
                          return '800000';
                      } elseif (($row['discounttype'] != 0 && ($row['matched'] > 0 || $row['volDiscType'] == 0)) 
                          || $row['voided'] == 2 || $row['voided'] == 6 || $row['voided'] == 4 || $row['voided'] == 5 || $row['voided'] == 10 || $row['voided'] == 22) {
                          return '408080';
                  Severity: Critical
                  Found in pos/is4c-nf/lib/DisplayLib.php - About 3 hrs to fix

                    CorePage has 30 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class CorePage 
                    {
                        public $description = "
                        Base class for creating HTML pages.
                        ";
                    Severity: Minor
                    Found in common/ui/CorePage.php - About 3 hrs to fix

                      Class BsonReader has 30 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          public class BsonReader : JsonReader
                          {
                              private const int MaxCharBytesSize = 128;
                              private static readonly byte[] SeqRange1 = new byte[] { 0, 127 }; // range of 1-byte sequence
                              private static readonly byte[] SeqRange2 = new byte[] { 194, 223 }; // range of 2-byte sequence

                        Class SPH_IngenicoRBA_Common has 30 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public abstract class SPH_IngenicoRBA_Common : SerialPortHandler 
                        {
                            protected byte[] last_message;
                            /** not used with on-demand implementation
                            private string terminal_serial_number;

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

                                  if ($this->mode == 'init'){
                                      $memNum = FormLib::get_form_value('memIN');
                                      if ($memNum != 0) {
                                          $q = $dbc->prepare("SELECT FirstName,LastName
                                              FROM {$OP}custdata
                          fannie/modules/plugins2.0/CoopCred/membership/CoopCredTransferTool.php on lines 157..173

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

                          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 post_u_handler()
                              {
                                  list($inStr, $args) = $this->connection->safeInClause($this->u);
                                  $prep = $this->connection->prepare('
                                      SELECT p.upc,
                          Severity: Major
                          Found in fannie/admin/labels/ManualSignsPage.php and 1 other location - About 3 hrs to fix
                          fannie/admin/labels/FpdfEditorPage.php on lines 54..80

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

                          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->mode == 'init') {
                                      $memNum = FormLib::get_form_value('memIN');
                                      if ($memNum != 0) {
                                          $q = $dbc->prepare("SELECT FirstName,LastName
                                              FROM {$OP}custdata
                          fannie/modules/plugins2.0/CoopCred/membership/CoopCredJiggerTool.php on lines 143..159

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

                          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 post_u_handler()
                              {
                                  list($inStr, $args) = $this->connection->safeInClause($this->u);
                                  $prep = $this->connection->prepare('
                                      SELECT p.upc,
                          Severity: Major
                          Found in fannie/admin/labels/FpdfEditorPage.php and 1 other location - About 3 hrs to fix
                          fannie/admin/labels/ManualSignsPage.php on lines 53..79

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

                          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

                                      foreach($info['Details'] as $issuer => $subinfo) {
                                          $record = array('', 
                                                          $issuer, 
                                                          $subinfo['Sales']['num'],
                                                          sprintf('%.2f', $subinfo['Sales']['amt']),
                          Severity: Major
                          Found in fannie/reports/Paycards/PcDailyReport.php and 2 other locations - About 3 hrs to fix
                          fannie/reports/Paycards/PcMonthlyReport.php on lines 159..170
                          fannie/reports/Paycards/PcMonthlyReport.php on lines 242..253

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

                          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

                                      foreach($info['Details'] as $issuer => $subinfo) {
                                          $record = array('', 
                                                          $issuer, 
                                                          $subinfo['Sales']['num'],
                                                          sprintf('%.2f', $subinfo['Sales']['amt']),
                          Severity: Major
                          Found in fannie/reports/Paycards/PcMonthlyReport.php and 2 other locations - About 3 hrs to fix
                          fannie/reports/Paycards/PcDailyReport.php on lines 140..151
                          fannie/reports/Paycards/PcMonthlyReport.php on lines 242..253

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

                          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

                                  foreach($proc['Details'] as $issuer => $info) {
                                      $record = array('', 
                                                      $issuer, 
                                                      $info['Sales']['num'],
                                                      sprintf('%.2f', $info['Sales']['amt']),
                          Severity: Major
                          Found in fannie/reports/Paycards/PcMonthlyReport.php and 2 other locations - About 3 hrs to fix
                          fannie/reports/Paycards/PcDailyReport.php on lines 140..151
                          fannie/reports/Paycards/PcMonthlyReport.php on lines 159..170

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

                          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 rtfToHtml($rtf)
                              {
                                  $temp = tempnam(sys_get_temp_dir(), 'rtf');
                                  file_put_contents($temp, $rtf);
                                  exec("unrtf {$temp}", $output);
                          Severity: Major
                          Found in fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php and 1 other location - About 3 hrs to fix
                          fannie/modules/plugins2.0/ChefTec/CTRecipes.php on lines 20..37

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

                          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