CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function fetch_report_data()
    {
        try {
            list($inStr, $args) = $this->connection->safeInClause($this->form->mt);
        } catch (Exception $ex) {
Severity: Minor
Found in fannie/reports/Household/HouseholdReport.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 fetch_report_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    function fetch_report_data()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('OP_DB'));
        $start = FormLib::get_form_value('date1','');
Severity: Minor
Found in fannie/reports/FloorSectionSales/floorSectionSalesReport.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 generateNewDeliNarrow_24UPTag has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function generateNewDeliNarrow_24UPTag($x, $y, $guide, $width, $height, $pdf, $row, $dbc, $showPrice, $showBarcode, $offset)
{
    $upc = $row['upc'];
    $desc = $row['description'];
    $brand = $row['brand'];
Severity: Minor
Found in fannie/admin/labels/pdf_layouts/New_WFC_Deli_Narrow.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 generateNewDeliRegular_24UPTag has a Cognitive Complexity of 19 (exceeds 5 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: Minor
Found in fannie/admin/labels/pdf_layouts/New_WFC_Deli_Regular.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 isSubscribed has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected function isSubscribed($record, $columns, $chimp, $LISTID, $memlist)
    {
        list($card_no, $email, $fname, $lname, $changed) = $this->unpackRecord($record, $columns);
        $memlist .= sprintf('%d,', $card_no);
        $this->custdata->reset();
Severity: Minor
Found in fannie/modules/plugins2.0/MailChimpSync/MailChimpTask.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 fetch_report_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetch_report_data()
    {
        $dbc = ObfLibV2::getDB();
        $start = FormLib::get('from');
        $end = FormLib::get('to');
Severity: Minor
Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfTrendReport.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 run has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        global $FANNIE_OP_DB, $FANNIE_TRANS_DB, $FANNIE_ARCHIVE_DB, $FANNIE_PLUGIN_SETTINGS,
            $FANNIE_SERVER, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW;

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

    public function post_id_shares_type_handler()
    {
        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB, $FANNIE_URL;

        $bridge = GumLib::getSetting('posLayer');
Severity: Minor
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumMainPage.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 run has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $settings = $this->config->PLUGIN_SETTINGS;
        $dbc = FannieDB::get($settings['TargetedPromosDB']);
        $warehouse = $settings['WarehouseDatabase'];
Severity: Minor
Found in fannie/modules/plugins2.0/TargetedPromos/tasks/DefectorTargetTask.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 run has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $settings = $this->config->PLUGIN_SETTINGS;
        $dbc = FannieDB::get($settings['TargetedPromosDB']);
        $warehouse = $settings['WarehouseDatabase'];

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 pullTable has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    static public function pullTable($table,$db='trans',
        $truncate=self::TRUNCATE_SOURCE,$one_lane=0)
    {
        global $FANNIE_OP_DB, $FANNIE_TRANS_DB, $FANNIE_LANES;

Severity: Minor
Found in fannie/modules/plugins2.0/CoopCred/sync/SyncLanesForPlugin.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 run has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $this->CREDENTIALS = json_decode(file_get_contents(__DIR__ . '/credentials.json'), true);
        $dbc = FannieDB::get(FannieConfig::config('TRANS_DB'));
        $payments = $this->getTransactions($dbc);
Severity: Minor
Found in fannie/modules/plugins2.0/RecurringEquity/EqRecurTask.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 body_content has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    function body_content()
    {
        $ret = '';
        $list = FormLib::get('l');

Severity: Minor
Found in fannie/mem/MemberEditor.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 pullTable has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    static public function pullTable($table,$db='trans',$truncate=self::TRUNCATE_SOURCE)
    {
        $config = \FannieConfig::factory();
        $op_db = $config->get('OP_DB');
        $trans_db = $config->get('TRANS_DB');
Severity: Minor
Found in fannie/classlib2.0/data/SyncLanes.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 deleteItemsFromScales has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    static public function deleteItemsFromScales($items, $scales=array())
    {
        $config = \FannieConfig::factory(); 

        if (!is_array($items)) {
Severity: Minor
Found in fannie/classlib2.0/item/HobartDgwLib.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_toIDs_handler has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

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

    protected function post_view()
    {
        $lcs = FormLib::get('lc');
        $cools = FormLib::get('cool');
        $lcP = $this->connection->prepare("SELECT * FROM likeCodes WHERE likeCode=?");
Severity: Minor
Found in fannie/item/likecodes/cool/CoolImportSave.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 post_save_handler has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    function post_save_handler()
    {
        global $FANNIE_OP_DB;

        $upcs = FormLib::get('upc', array());
Severity: Minor
Found in fannie/item/EditItemsFromSearch.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 findOpenRange has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private function findOpenRange($dbc, $min, $max) 
    {
        $current = $min;
        $range_start = false;
        $lookup = $dbc->prepare('SELECT upc FROM products WHERE upc=?');
Severity: Minor
Found in fannie/item/PluRangePage.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 readLocalPackages has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private function readLocalPackages($path)
    {
        $vendor = $path . DIRECTORY_SEPARATOR . 'vendor';
        if (!file_exists($vendor) || !is_dir($vendor) || !is_readable($vendor)) {
            return array();
Severity: Minor
Found in common/DeComposer.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

Severity
Category
Status
Source
Language