CORE-POS/IS4C

View on GitHub
fannie/item/modules/VendorItemModule.php

Summary

Maintainability
D
1 day
Test Coverage
F
10%

Function SaveFormData has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    function SaveFormData($upc){
        $upc = BarcodeLib::padUPC($upc);
        $ids = FormLib::get_form_value('v_id',array());
        $skus = FormLib::get_form_value('v_sku',array());
        $costs = FormLib::get_form_value('v_cost',array());
Severity: Minor
Found in fannie/item/modules/VendorItemModule.php - About 6 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 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 SaveFormData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function SaveFormData($upc){
            $upc = BarcodeLib::padUPC($upc);
            $ids = FormLib::get_form_value('v_id',array());
            $skus = FormLib::get_form_value('v_sku',array());
            $costs = FormLib::get_form_value('v_cost',array());
    Severity: Major
    Found in fannie/item/modules/VendorItemModule.php - About 2 hrs to fix

      Function showEditForm has a Cognitive Complexity of 12 (exceeds 5 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: Minor
      Found in fannie/item/modules/VendorItemModule.php - About 1 hr 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

      There are no issues that match your filters.

      Category
      Status