CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

function reprice($oid,$tid,$reg=false)
{
    global $FANNIE_OP_DB, $TRANS;
    $dbc = FannieDB::get($FANNIE_OP_DB);

Severity: Minor
Found in fannie/ordering/ajax-calls.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 reprice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function reprice($oid,$tid,$reg=false)
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('OP_DB'));
        $TRANS = $this->config->get('TRANS_DB') . $dbc->sep();
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 filterMovement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function filterMovement($items, $form)
    {
        if ($form->soldOp !== '') {
            list($days, $store) = explode(':', $form->soldOp);
            $movementStart = date('Y-m-d', mktime(0, 0, 0, date('n'), date('j')-$days-1, date('Y')));
Severity: Minor
Found in fannie/item/AdvancedItemSearch.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 searchSignage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function searchSignage($search, $form)
    {
        if ($form->signinfo !== '') {
            if (!strstr($search->from, 'productUser')) {
                $search->from .= ' LEFT JOIN productUser AS s ON p.upc=s.upc ';
Severity: Minor
Found in fannie/item/AdvancedItemSearch.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 preprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function preprocess()
    {
        $mods = $this->getConfiguredModules();

        $this->title = _('Fannie') . ' - ' . _('Item Maintenance');
Severity: Minor
Found in fannie/item/ItemEditorPage.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 helpContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function helpContent()
    {
        $ret = '<p>This tool is for adding or editing an item</p>';
        if ($this->mode == 'search') {
            $ret .= '<p>
Severity: Minor
Found in fannie/item/ItemEditorPage.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 searchUPCs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function searchUPCs($search, $form)
    {
        if ($form->upcs !== '') {
            $upcs = explode("\n", $form->upcs);
            $upcs = array_map(function($i) {
Severity: Minor
Found in fannie/item/AdvancedItemSearch.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_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function post_id_handler()
    {
        $dbc = FannieDB::get($this->config->get('OP_DB'));
        $new = FormLib::get('new-upc');
        
Severity: Minor
Found in fannie/item/CloneItemPage.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 objToNames has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function objToNames($obj, $name, $shortName)
    {
        if (empty($name)) {
            $name = $obj->name();
        } else if ($obj->abbr() != '') {
Severity: Minor
Found in fannie/item/origins/OriginEditor.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 get_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_view()
    {
        $scaleTypes = array();
        $res = $this->connection->query('SELECT scaleType FROM ServiceScales GROUP BY scaleType ORDER BY scaleType');
        while ($row = $this->connection->fetchRow($res)) {
Severity: Minor
Found in fannie/item/hobartcsv/ScaleLabelEditor.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 searchVendor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function searchVendor($search, $form)
    {
        if ($form->vendor === '0') {
            $search->where .= ' AND p.default_vendor_id=0 ';
        } elseif ($form->vendor !== '') {
Severity: Minor
Found in fannie/item/AdvancedItemSearch.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 exportAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function exportAll($store)
    {
        $promoP = $this->connection->prepare('
            SELECT q.upc, SUM(total), SUM(saleTotal)
            FROM ' . FannieDB::fqn('productWeeklyLastQuarter', 'arch') . ' as q
Severity: Minor
Found in fannie/item/ContributionTool.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_originID_custom_state_country_local_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function post_originID_custom_state_country_local_handler()
    {
        global $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);
        $model = new OriginsModel($dbc);
Severity: Minor
Found in fannie/item/origins/OriginEditor.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_u_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function post_u_handler()
    {
        if (!is_array($this->u)) {
            $this->u = array($this->u);
        }
Severity: Minor
Found in fannie/item/hobartcsv/SyncFromSearch.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 get_id_print_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_id_print_handler()
    {
        $pdf = new FPDF('P', 'mm', 'Letter');
        $pdf->AddPage();
        $pdf->SetMargins(10,10,10);
Severity: Minor
Found in fannie/item/vendors/SkuMapPage.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 get_id_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in fannie/item/likecodes/LikeCodeAjax.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_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_id_handler()
    {
        $prod = new ProductsModel($this->connection);
        $meta = new MetaProductRulesModel($this->connection);
        $valid = array_keys($prod->getColumns());
Severity: Minor
Found in fannie/item/MetaRules.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 monthOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function monthOptions()
    {
        global $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);
        $prep = $dbc->prepare("SELECT dealSet FROM CoopDealsItems GROUP BY dealSet");
Severity: Minor
Found in fannie/item/CoopDealsLookupPage.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 get_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_view()
    {
        $dbc = FannieDB::get($this->config->get('OP_DB'));
        $vendors = "<option value=\"\">Select a vendor...</option>";
        $vendors .= "<option value=\"new\">New vendor...</option>";
Severity: Minor
Found in fannie/item/vendors/VendorIndexPage.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_info_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_info_handler()
    {
        if (!$this->canEdit) return false;
        $id = FormLib::get('vendorID','');
        if ($id === '') {
Severity: Minor
Found in fannie/item/vendors/VendorIndexPage.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