CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method standardItemFields has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function standardItemFields()
    {
        $dbc = FannieDB::getReadOnly(FannieConfig::config('OP_DB'));
        ob_start();
        ?>
Severity: Major
Found in fannie/classlib2.0/lib/FormLib.php - About 3 hrs to fix

    Method writeItemsToScales has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static public function writeItemsToScales($items, $scales=array())
        {
            $config = \FannieConfig::factory(); 
            if (!isset($items[0])) {
                $items = array($items);
    Severity: Major
    Found in fannie/classlib2.0/item/HobartDgwLib.php - About 3 hrs to fix

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

          public function form_content($newClassUpc)
          {
              $this->addOnloadCommand("$('#date').datepicker({dateFormat: 'mm-dd-yy'});");
      
              return <<<HTML
      Severity: Major
      Found in fannie/item/WFC-Uproducts/NewClassPage.php - About 3 hrs to fix

        Method ReadType has 98 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private void ReadType(BsonType type)
                {
                    switch (type)
                    {
                        case BsonType.Number:

          Function handleResponseAuth has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function handleResponseAuth($authResult)
              {
                  $xml = new XmlData($authResult["response"]);
                  $request = $this->last_request;
                  $this->last_paycard_transaction_id = $request->last_paycard_transaction_id;
          Severity: Minor
          Found in pos/is4c-nf/plugins/Paycards/Valutec.php - About 3 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 textField has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function textField($name, $default_value='', $storage=Conf::EITHER_SETTING, $quoted=true, $attributes=array(), $area=false)
              {
                  $current_value = $this->getCurrentValue($name, $default_value, $quoted);
          
                  // sanitize values:
          Severity: Minor
          Found in pos/is4c-nf/install/conf/FormFactory.php - About 3 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 addItem has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function addItem(array $row, $quantity, $priceObj)
              {
                  if ($quantity == 0) return false;
          
                  $pricing = $priceObj->priceInfo($row,$quantity);
          Severity: Minor
          Found in pos/is4c-nf/lib/Scanning/PriceMethods/BigGroupPM.php - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
          Open

              function process_file($linedata, $indexes)
              {
                  $dbc = $this->connection;
                  $dbc->selectDB($this->config->get('OP_DB'));
                  $idP = $dbc->prepare("
          Severity: Minor
          Found in fannie/batches/UNFI/load-classes/GardenOfLifeUploadPage.php - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function fetch_report_data()
              {
                  $store = FormLib::get('store', false);
                  if (!$store) {
                      $store = COREPOS\Fannie\API\lib\Store::getIdByIp();
          Severity: Minor
          Found in fannie/batches/EndCapper/EndCapperReport.php - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function fetch_report_data()
              {
                  $dbc = $this->connection;
                  $dbc->selectDB($this->config->get('OP_DB'));
          
          
          Severity: Minor
          Found in fannie/reports/Trends/TrendsReport.php - About 3 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 prefsView has a Cognitive Complexity of 27 (exceeds 5 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: Minor
          Found in fannie/modules/plugins2.0/CalendarPlugin/CalendarPluginDisplayLib.php - About 3 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 getTotals has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              private function getTotals($date1, $date2, $store)
              {
                  $settings = $this->config->get('PLUGIN_SETTINGS');
                  $dbc = $this->connection;
                  $dbc->selectDB($settings['OverShortDatabase']);
          Severity: Minor
          Found in fannie/modules/plugins2.0/OverShortTools/OsVarianceReport.php - About 3 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 run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function run()
              {
                  $dbc = FannieDB::get($this->config->get('OP_DB'));
          
                  if (!class_exists('InstaFileV3')) {
          Severity: Minor
          Found in fannie/modules/plugins2.0/InstaCart/InstaWfcExport.php - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function get_view()
              {
                  $storeID = Store::getIdByIp();
                  $storeID=1;
                  $catP = $this->connection->prepare("SELECT deliCategoryID, name, salesCode FROM DeliCategories WHERE storeID=? ORDER BY seq, name");
          Severity: Minor
          Found in fannie/modules/plugins2.0/DeliInventory/DIPage.php - About 3 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 updateViews has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              function updateViews ($dbc) {
                  global $FANNIE_PLUGIN_SETTINGS;
          
                  $models = array(
                      array('name' => 'CCredHistoryTodayModel', 'drop' => True)
          Severity: Minor
          Found in fannie/modules/plugins2.0/CoopCred/programs/CoopCredProgramEditor.php - About 3 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 getBottomImage has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              private function getBottomImage($item)
              {
                  // Manual Signs Page && smartType override checked takes precedence
                  if (isset($item['smartType']) && $item['smartType'] == 'CoopDeals') {
                      return __DIR__ . '/cd_line_16.png';
          Severity: Minor
          Found in fannie/modules/plugins2.0/CoopDealsSigns/LegacySmartSigns4UpL.php - About 3 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_id_view has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function get_id_view()
              {
                  $dbc = $this->connection;
                  $dbc->selectDB($this->config->get('OP_DB'));
          
          
          Severity: Minor
          Found in fannie/purchasing/ViewPurchaseOrders.php - About 3 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 getUpdateItemLine has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              static private function getUpdateItemLine($item_info, $labelInfo)
              {
                  $line = 'CCOSPIC' . chr(253); 
                  foreach (ServiceScaleLib::$WRITE_ITEM_FIELDS as $key => $field_info) {
                      if (isset($item_info[$key])) {
          Severity: Minor
          Found in fannie/classlib2.0/item/EpScaleLib.php - About 3 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_id_view has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function get_id_view()
              {
                  global $FANNIE_OP_DB;
                  $ret = $this->get_view();
                  $upc = BarcodeLib::padUPC($this->id);
          Severity: Minor
          Found in fannie/item/handheld/ItemStatusPage.php - About 3 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

          Method GetChildPrivateProperties has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
          Open

                  private static void GetChildPrivateProperties(IList<PropertyInfo> initialProperties, Type targetType, BindingFlags bindingAttr)
                  {
                      // fix weirdness with private PropertyInfos only being returned for the current Type
                      // find base type properties and add them to result
          
          

          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