CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function preFlight has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function preFlight()
    {
        if (!($this->config instanceof FannieConfig)) {
            $this->config = FannieConfig::factory();
        }
Severity: Minor
Found in fannie/classlib2.0/FanniePage.php - About 2 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 editableItemList has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function editableItemList($orderID)
{
    global $FANNIE_OP_DB, $TRANS;
    $dbc = FannieDB::get($FANNIE_OP_DB);

Severity: Minor
Found in fannie/ordering/ajax-calls.php - About 2 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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_view()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('OP_DB'));
        $TRANS = $this->config->get('TRANS_DB') . $dbc->sep();
Severity: Minor
Found in fannie/ordering/NewSpecialOrdersPage.php - About 2 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 editForm has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private function editForm($upc,$isNew)
    {
        $FANNIE_PRODUCT_MODULES = $this->getConfiguredModules();
        $FANNIE_URL = $this->config->get('URL');
        $shown = array();
Severity: Minor
Found in fannie/item/ItemEditorPage.php - About 2 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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_view()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('OP_DB'));
        // for now, only denfeld is being shown
Severity: Minor
Found in fannie/item/FloorSections/NewPageO.php - About 2 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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function process_file($linedata, $indexes)
    {
        global $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);

Severity: Minor
Found in fannie/item/vendors/UploadPluMapPage.php - About 2 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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_view()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('OP_DB'));
        $model = new $this->model_name($dbc);
Severity: Minor
Found in fannie/item/IgnoredBarcodeEditor.php - About 2 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 insertRecord has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function insertRecord()
    {
        $sql = 'INSERT INTO '.$this->fq_name;
        $cols = '(';
        $vals = '(';
Severity: Minor
Found in common/BasicModel.php - About 2 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

File baseItem.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var baseItem = (function() {
    var mod = {};

    mod.chainSubs = function(store_id) {
        chainSubDepartments(
Severity: Minor
Found in fannie/item/modules/baseItem.js - About 2 hrs to fix

    File BasicCCModule.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2007 Whole Foods Co-op
    
    
    Severity: Minor
    Found in pos/is4c-nf/plugins/Paycards/BasicCCModule.php - About 2 hrs to fix

      File FirstData.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2007,2010 Whole Foods Co-op
      
      
      Severity: Minor
      Found in pos/is4c-nf/plugins/Paycards/FirstData.php - About 2 hrs to fix

        File Steering.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2007 Whole Foods Co-op
        
        
        Severity: Minor
        Found in pos/is4c-nf/parser/parse/Steering.php - About 2 hrs to fix

          Method handle has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function handle($upc,$json)
              {
                  $orderID = substr($upc,5,6);
                  $transID = substr($upc,11,2);
          
          
          Severity: Major
          Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/SpecialOrder.php - About 2 hrs to fix

            Method recalculate has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function recalculate($dbc, $batchID, $startDate, $endDate)
                {
                    $span = $endDate->diff($startDate);
                    $days = $span->format('%a') + 1;
                    $oneDay = new DateInterval('P1D');
            Severity: Major
            Found in fannie/cron/tasks/SalesLiftTask.php - About 2 hrs to fix

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

                  public function run()
                  {
                      global $FANNIE_OP_DB;
                      $sql = FannieDB::get($FANNIE_OP_DB);
                      $sql->throwOnFailure(true);
              Severity: Major
              Found in fannie/cron/tasks/TableSnapshotTask.php - About 2 hrs to fix

                Method form_content has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function form_content()
                    {
                        $dbc = $this->connection;
                        $dbc->selectDB($this->config->get('OP_DB'));
                
                
                Severity: Major
                Found in fannie/reports/DepartmentSettings/DeptSettingsReport.php - About 2 hrs to fix

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

                      public function fetch_report_data()
                      {
                          $dbc = $this->connection;
                          try {
                              $date1 = $this->form->date1;
                  Severity: Major
                  Found in fannie/reports/Accounting/ArByDay.php - About 2 hrs to fix

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

                        public function fetch_report_data()
                        {
                            $dbc = $this->connection;
                            $dbc->selectDB($this->config->get('OP_DB'));
                            $date1 = FormLib::get('date1', date('Y-m-d'));
                    Severity: Major
                    Found in fannie/reports/from-search/CustomerSales/CustomerSalesReport.php - About 2 hrs to fix

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

                          public function fetch_report_data()
                          {        
                              
                              $dbc = $this->connection;
                              $dbc->selectDB($this->config->get('TRANS_DB'));
                      Severity: Major
                      Found in fannie/reports/MemberAccess/MemberAccess.php - About 2 hrs to fix

                        Method get_id_creceipt_cid_handler has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function get_id_creceipt_cid_handler()
                            {
                                global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                        
                                $bridge = GumLib::getSetting('posLayer');
                        Severity: Major
                        Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumEmailPage.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language