CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function WFC_Bulk_Repack_14UP has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function WFC_Bulk_Repack_14UP($data,$offset=0,$showPrice=0)
{
    $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
    $pdf = new WFC_Bulk_Repack_14UP_PDF('L','mm','Letter');
    $pdf->AddPage();
Severity: Minor
Found in fannie/admin/labels/pdf_layouts/WFC_Bulk_Repack_14UP.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 WFC_HerbNspice_Flat has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function WFC_HerbNspice_Flat($data,$offset=0,$showPrice=0)
{
    $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
    $pdf = new WFC_HerbNspice_Flat_PDF('L','mm','Letter');
    $pdf->AddPage();
Severity: Minor
Found in fannie/admin/labels/pdf_layouts/WFC_HerbNspice_Flat.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 WFC_New_MEAT_14UP has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function WFC_New_MEAT_14UP($data,$offset=0,$showPrice=0)
{
    $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
    $pdf = new WFC_New_MEAT_14UP_PDF('L','mm','Letter');
    $pdf->AddPage();
Severity: Minor
Found in fannie/admin/labels/pdf_layouts/WFC_New_MEAT_14UP.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 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetch_report_data()
    {
        $class_lib = $this->class_lib;
        $dbc = $class_lib::getDB();
        
Severity: Minor
Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.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 25 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_view()
    {
        $editCSS = 'collapse';
        $includeList = false;
        if (FannieAuth::validateUserQuiet('hr_editor') || FannieAuth::validateUserQuiet('illness_editor')) {
Severity: Minor
Found in fannie/modules/plugins2.0/HrWeb/IllnessLog/IllnessLogsPage.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 getIngredientList has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private function getIngredientList($dbc, $id)
    {
        /**
         * Query notes:
         *
Severity: Minor
Found in fannie/modules/plugins2.0/ChefTec/CTRecipes.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 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
        $dbc = FannieDB::get($FANNIE_OP_DB);

Severity: Minor
Found in fannie/modules/plugins2.0/UnfiInvoiceGrabber/UIGTask.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 parseWFC has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseWFC($fp, $dbc)
    {
        $limit = '
            SELECT MAX(tdate) AS tdate
            FROM EmailUsageLog
Severity: Minor
Found in fannie/modules/plugins2.0/EmailReporting/EmailLogParseTask.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 post_id_handler has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function post_id_handler()
    {
        $dbc = FannieDB::get($this->config->get('OP_DB'));
        $ret = array('error' => false);

Severity: Minor
Found in fannie/purchasing/ManualPurchaseOrderPage.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 memLinksPrevNext has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static function memLinksPrevNext($card_no, $list=array())
    {
        $prev = false;
        $next = false;
        if (is_array($list) && count($list) > 0) {
Severity: Minor
Found in fannie/mem/MemberEditor.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 basicPreview has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    protected function basicPreview()
    {
        $ret = '<h3>Select columns</h3>';
        /* show any errors */
        if ($this->error_details != 'n/a' && $this->error_details != '') {
Severity: Minor
Found in fannie/classlib2.0/FannieUploadPage.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 forceStartBatch has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function forceStartBatch($id, $upc=false)
    {
        $b_def = $this->connection->tableDefinition($this->name);
        $bt_def = $this->connection->tableDefinition('batchType');
        $exit = isset($bt_def['exitInventory']) ? 'exitInventory' : '0 AS exitInventory';
Severity: Minor
Found in fannie/classlib2.0/data/models/op/BatchesModel.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 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function run($args=array())
    {
        $ret = array();
        if (!property_exists($args, 'upc')) {
            // missing required arguments
Severity: Minor
Found in fannie/classlib2.0/webservices/FannieItemLaneSync.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 getItemLine has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    static public function getItemLine($item_info, $scaleType='HOBART_QUANTUMTCP')
    {
        $line = '';
        // first write fields that are present
        foreach(ServiceScaleLib::$WRITE_ITEM_FIELDS as $key => $field_info) {
Severity: Minor
Found in fannie/classlib2.0/item/HobartDgwLib.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 getConfiguredModules has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private function getConfiguredModules()
    {
        $FANNIE_PRODUCT_MODULES = $this->config->get('PRODUCT_MODULES');
        if (!is_array($FANNIE_PRODUCT_MODULES)) {
            $FANNIE_PRODUCT_MODULES = array('BaseItemModule' => array('seq'=>0, 'show'=>1, 'expand'=>1));
Severity: Minor
Found in fannie/item/ItemEditorPage.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 addAllLanes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function addAllLanes($upc, $table_name){

    $FANNIE_OP_DB = FannieConfig::config('OP_DB');
    $FANNIE_LANES = FannieConfig::config('LANES');
    $STORE_MODE = FannieConfig::config('STORE_MODE');
Severity: Minor
Found in fannie/item/laneUpdates_WEFC_Toronto.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 ParseValue has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
Open

        private bool ParseValue()
        {
            while (true)
            {
                char currentChar = _chars[_charPos];

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 ExecuteFilter has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
Open

        public override IEnumerable<JToken> ExecuteFilter(IEnumerable<JToken> current, bool errorWhenNoMatch)
        {
            foreach (JToken root in current)
            {
                if (Name == null)

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 sendVoid has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function sendVoid()
    {
        $this->GATEWAY = 'https://api.payeezy.com/v1/transactions/' . $authcode;
        $this->GATEWAY = 'https://api.globalgatewaye4.firstdata.com/transaction/v32';
        if ($this->conf->get("training") == 1) {
Severity: Major
Found in pos/is4c-nf/plugins/Paycards/ValueLink.php - About 3 hrs to fix

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

        public function run()
        {
            global $FANNIE_OP_DB, $FANNIE_TRANS_DB, $FANNIE_ARCHIVE_DB;
    
            $dbc = FannieDB::get($FANNIE_ARCHIVE_DB);
    Severity: Major
    Found in fannie/cron/tasks/ProductSummarizeLastQuarter.php - About 3 hrs to fix
      Severity
      Category
      Status
      Source
      Language