CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function hookAddColumnowner has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function hookAddColumnowner()
    {
        // copy existing values from batchowner.owner to
        // new batches.owner column
        if ($this->connection->table_exists('batchowner')) {
Severity: Minor
Found in fannie/classlib2.0/data/models/op/BatchesModel.php - About 25 mins 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 hookAddColumnmargin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function hookAddColumnmargin()
    {
        if ($this->connection->table_exists('deptMargin')) {
            $dataR = $this->connection->query('SELECT dept_ID, margin FROM deptMargin');
            $tempModel = new DepartmentsModel($this->connection);
Severity: Minor
Found in fannie/classlib2.0/data/models/op/DepartmentsModel.php - About 25 mins 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 expandUPCE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function expandUPCE($entered)
    {
        $par6 = substr($entered, -1);
        if ($par6 == 0) $entered = substr($entered, 0, 3)."00000".substr($entered, 3, 3);
        elseif ($par6 == 1) $entered = substr($entered, 0, 3)."10000".substr($entered, 3, 3);
Severity: Minor
Found in fannie/classlib2.0/lib/BarcodeLib.php - About 25 mins 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 drawPDF has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function drawPDF()
    {
        $pdf = new \FPDF('P', 'mm', 'Letter');
        $pdf->SetMargins(3.175, 3.175, 3.175);
        $pdf->SetAutoPageBreak(false);
Severity: Minor
Found in fannie/classlib2.0/item/signage/GravityBin.php - About 25 mins 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 getAllAccounts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getAllAccounts($dbc)
    {
        $account = new CustomerAccountsModel($dbc);
        $customers = new CustomersModel($dbc);
        $accounts = array();
Severity: Minor
Found in fannie/classlib2.0/member/MemberREST.php - About 25 mins 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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static public function check($key=false)
    {
        $FANNIE_ARCHIVE_DB = \FannieConfig::factory()->get('ARCHIVE_DB');
        $dbc = \FannieDB::get($FANNIE_ARCHIVE_DB, $current_db);
        $table = $FANNIE_ARCHIVE_DB.$dbc->sep()."reportDataCache";
Severity: Minor
Found in fannie/classlib2.0/data/DataCache.php - About 25 mins 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 txtToArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function txtToArray($filename, $limit=0)
    {
        $fptr = fopen($filename,'r');
        if (!$fptr) {
            return array();
Severity: Minor
Found in fannie/classlib2.0/data/FileData.php - About 25 mins 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 getCustdataCustomers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getCustdataCustomers($dbc, $id)
    {
        $query = '
            SELECT c.personNum,
                c.FirstName,
Severity: Minor
Found in fannie/classlib2.0/member/MemberREST.php - About 25 mins 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 postMemberCards has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function postMemberCards($dbc, $id, $json, $ret)
    {
        if (isset($json['idCardUPC'])) {
            $cards = self::getModel($dbc, 'MemberCardsModel');
            $cards->card_no($id);
Severity: Minor
Found in fannie/classlib2.0/member/MemberREST.php - About 25 mins 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 bestRoute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function bestRoute($try_routes)
    {
        // use the route with the most parameters
        // set class variables to parameters
        $num_params = array_keys($try_routes);
Severity: Minor
Found in fannie/classlib2.0/FannieRESTfulPage.php - About 25 mins 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 csvToArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function csvToArray($filename, $limit=0)
    {
        $fptr = fopen($filename,'r');
        if (!$fptr) {
            return array();
Severity: Minor
Found in fannie/classlib2.0/data/FileData.php - About 25 mins 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 fastSearchResults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function fastSearchResults($dbc, $ids)
    {
        list($inStr, $args) = $dbc->safeInClause($ids);
        $config = FannieConfig::factory();
        if ($config->get('CUST_SCHEMA') == 1 && $dbc->tableExists('CustomerAccounts') && $dbc->tableExists('Customers')) {
Severity: Minor
Found in fannie/classlib2.0/member/MemberREST.php - About 25 mins 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 printItemRow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function printItemRow($row, $depts)
    {
        $ret = sprintf('<tr>
                <td>%s</td>
                <td>%s</td>
Severity: Minor
Found in fannie/ordering/OrderReviewPage.php - About 25 mins 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_orderID_noteDept_noteText_ph1_ph2_email_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_orderID_noteDept_noteText_ph1_ph2_email_handler()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('TRANS_DB'));

Severity: Minor
Found in fannie/ordering/OrderViewPage.php - About 25 mins 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 getItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getItem($upc)
    {
        if (trim($upc) !== '' && !preg_match('/^0+$/', trim($upc))) {
            $item = self::getItemByUPC($upc);
            if ($item !== false) {
Severity: Minor
Found in fannie/ordering/OrderItemLib.php - About 25 mins 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 labelToAttributes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static public function labelToAttributes($label_number)
    {
        $ret = array(
            'align' => 'vertical',
            'fixed_weight' => false,
Severity: Minor
Found in fannie/classlib2.0/item/ServiceScaleLib.php - About 25 mins 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 upcToPLU has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static public function upcToPLU($upc)
    {
        $upc = BarcodeLib::padUPC($upc);
        $len = FannieConfig::config('SPLU_LENGTH');
        if ($len != 4 && $len != 5) {
Severity: Minor
Found in fannie/classlib2.0/item/ServiceScaleLib.php - About 25 mins 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_commID_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_id_commID_handler()
    {
        $dbc =  $this->tdb();
        $msg = '';
        switch ($this->commID) {
Severity: Minor
Found in fannie/ordering/OrderAjax.php - About 25 mins 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 resultToItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function resultToItem($dbc, $prodR)
    {
        $prodW = $dbc->fetchRow($prodR);
        $ret = self::$generic_item;
        foreach ($ret as $key => $val) {
Severity: Minor
Found in fannie/ordering/OrderItemLib.php - About 25 mins 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 getQueuedIDs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getQueuedIDs($oids)
    {
        $username = FannieAuth::checkLogin();
        $cachepath = sys_get_temp_dir()."/ordercache/";
        if (file_exists("{$cachepath}{$username}.prints")){
Severity: Minor
Found in fannie/ordering/SpecialOrderTags.php - About 25 mins 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