CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function get_view()
    {
        $ret = '';
        $ret .= '<form target="_blank" action="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '" method="post" id="signform">';
        $mods = FannieAPI::listModules('\COREPOS\Fannie\API\item\FannieSignage');
Severity: Major
Found in fannie/admin/labels/ManualSignsPage.php - About 4 hrs to fix

    Method generateNewDeliRegular_24UPTag has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function generateNewDeliRegular_24UPTag($x, $y, $guide, $width, $height, $pdf, $row, $dbc, $showPrice, $showBarcode, $offset)
    {
        $upc = $row['upc'];
        $desc = $row['description'];
        $brand = $row['brand'];
    Severity: Major
    Found in fannie/admin/labels/pdf_layouts/New_WFC_Deli_Regular.php - About 4 hrs to fix

      Method settingChange has 115 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function settingChange()
          {
              global $FANNIE_PLUGIN_SETTINGS;
      
              /* Would like to accumulate problems here
      Severity: Major
      Found in fannie/modules/plugins2.0/CoopCred/CoopCred.php - About 4 hrs to fix

        Method process_file has 115 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/purchasing/ImportPurchaseOrder.php - About 4 hrs to fix

          Method get_vendor_view has 115 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function get_vendor_view()
              {
                  $vid = $this->vendor;
                  $vendorID = FormLib::get('vendor');
          
          
          Severity: Major
          Found in fannie/item/ProdReviewPage.php - About 4 hrs to fix

            File HourlyTransReport.php has 358 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /*******************************************************************************
            
                Copyright 2013 Whole Foods Co-op
            
            
            Severity: Minor
            Found in fannie/reports/HourlyTrans/HourlyTransReport.php - About 4 hrs to fix

              Function manageComments has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

              var manageComments = (function($) {
              
                  var mod = {};
              
                  mod.sendMsg = function() {
              Severity: Minor
              Found in fannie/modules/plugins2.0/CommentTracker/js/manageComments.js - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function scanner has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

              var scanner = (function ($) {
                  var mod = {};
              
                  var lastSearch = 0;
              
              
              Severity: Minor
              Found in fannie/modules/plugins2.0/DeliInventory/scanner.js - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function lookupTransaction has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function lookupTransaction($ref, $local, $mode)
                  {
                      $merchantID = $this->conf->get('GoEMerchID');
                      $password = $this->conf->get('GoEMerchPassword');
                      $gatewayID = $this->conf->get('GoEmerchGatewayID');
              Severity: Minor
              Found in pos/is4c-nf/plugins/Paycards/GoEMerchant.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function listModules has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  static public function listModules($baseClass, $includeBase=False)
                  {
                      $ret = array();
                      
                      // lookup plugin modules, then standard modules
              Severity: Minor
              Found in pos/is4c-nf/lib/AutoLoader.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function checkLimits has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function checkLimits($coupID)
                  {
                      $infoW = $this->lookupCoupon($coupID);
                      if ($infoW === false) {
                          return $this->errorOrQuiet(_('coupon not found'), false);
              Severity: Minor
              Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function fetch_report_data has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function fetch_report_data()
                  {
                      $this->month = FormLib::get('month', date('n'));
                      $this->year = FormLib::get('year', date('Y'));
              
              
              Severity: Minor
              Found in fannie/reports/Paycards/PcMonthlyReport.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function WFC_Produce_Single has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

              function WFC_Produce_Single($data,$offset=0){
              
              $pdf=new WFC_Produce_Single_PDF('L','mm',array(25.4, 53.975)); //start new instance of PDF
              $pdf->Open(); //open new PDF Document
              $pdf->setTagDate(date("m/d/Y"));
              Severity: Minor
              Found in fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function format has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function format(array $row)
                  {
                      if ($row['trans_type'] == 'D') {
                          // department open ring; not much to format
                          return $this->align($row['description'],'',$row['total'],$this->flags($row));
              Severity: Minor
              Found in fannie/modules/plugins2.0/EReceipt/Format/ItemEReceiptFormat.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function get_view has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function get_view()
                  {
                      $authorized = false;
                      if (FannieAuth::validateUserQuiet('ordering_edit')) {
                          $authorized = true;
              Severity: Minor
              Found in fannie/modules/plugins2.0/DeliInventory/DIPage2.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function process has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function process($filename)
                  {
                      $fp = fopen($filename, 'r');
                      $currentOrder = array('id' => false, 'total' => 0, 'qty' => 0, 'fees' => 0, 'card_no' => 11, 'tdate' => '', 'items' => array());
                      $storeID = 0;
              Severity: Minor
              Found in fannie/modules/plugins2.0/Mercato/MercatoConvert.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function preprocess has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  function preprocess(){
                      global $FANNIE_AR_DEPARTMENTS;
                      global $FANNIE_EQUITY_DEPARTMENTS;
                      global $FANNIE_OP_DB;
                      global $FANNIE_EMP_NO, $FANNIE_REGISTER_NO;
              Severity: Minor
              Found in fannie/mem/correction_pages/MemArEquitySwapTool.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function drawPDF has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function drawPDF()
                  {
                      $pdf = new \FPDF('L', 'mm', 'Letter');
                      $pdf->SetMargins(6.35, 6.35, 6.35);
                      $pdf->SetAutoPageBreak(false);
              Severity: Minor
              Found in fannie/classlib2.0/item/signage/Giganto1UpL.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function process_file has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

                  function process_file($linedata, $indexes)
                  {
                      global $FANNIE_OP_DB;
                      $dbc = FannieDB::get($FANNIE_OP_DB);
              
              
              Severity: Minor
              Found in fannie/item/hobartcsv/HobartItemCsvUploadPage.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function writeitem has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

              function writeitem($filename,$scaletype,$scaleip,$department,$writetype,
                                 $plu,$itemdesc,$tare,$shelflife,$price,$bycount,$type,
                                 $exception,$label,$graphics){
                $fp = fopen($filename,"w+");
                fputs($fp,"Record Type,Task Department,Task Destination,Task Destination Device,Task Destination Type\r\n");
              Severity: Minor
              Found in fannie/item/hobartcsv/writecsv.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language