CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function process_file has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function process_file($linedata, $indexes)
    {
        global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
        $EMP_NO = $this->config->get('EMP_NO');
        $LANE_NO = $this->config->get('REGISTER_NO');
Severity: Minor
Found in fannie/modules/plugins2.0/WfcAbandonEquity/WfcAbandonEquityImport.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 processMail has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function processMail($msg)
    {
        $info = $this->parseEmail($msg);
        $boundary = $this->hasAttachments($info['headers']);
        $fto = new FileToOrder();
Severity: Minor
Found in fannie/modules/plugins2.0/CpwInvoiceImport/DeliMailPipe.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 getList has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function getList()
    {
        $settings = $this->config->get('PLUGIN_SETTINGS');
        $this->connection->selectDB($this->config->get('OP_DB'));
        $uid = FannieAuth::getUID($this->current_user);
Severity: Minor
Found in fannie/modules/plugins2.0/ShelfAudit/SaItemList.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_id_sku_handler has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_id_sku_handler()
    {
        $dbc = $this->connection;
        $model = new PurchaseOrderItemsModel($dbc);
        $model->orderID($this->id);
Severity: Minor
Found in fannie/purchasing/ViewPurchaseOrders.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 loadClass has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    static public function loadClass($name)
    {
        $session = self::session();
        $map = isset($session->FannieClassMap) ? $session->FannieClassMap : array();

Severity: Minor
Found in fannie/classlib2.0/FannieAPI.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 batchNotification has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    static public function batchNotification($batchID, $upc, $type, $is_likecode=false)
    {
        $conf = FannieConfig::factory();
        $dbc = FannieDB::getReadOnly($conf->get('OP_DB'));

Severity: Minor
Found in fannie/classlib2.0/lib/AuditLib.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 addProductAllLanes has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private static function addProductAllLanes($upc)
    {
        $FANNIE_OP_DB = \FannieConfig::config('OP_DB');
        $FANNIE_LANES = \FannieConfig::config('LANES');
        $STORE_MODE = \FannieConfig::config('STORE_MODE');
Severity: Minor
Found in fannie/classlib2.0/data/ItemSync.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 checkRoute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function checkRoute($route, $try_routes)
    {
        $params = $this->routeParams($route);    
        if ($params === false || count($params) === 0) {
            // route with no params
Severity: Minor
Found in fannie/classlib2.0/FannieRESTfulPage.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 listFromBatches has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function listFromBatches($dbc)
    {
        if (!is_array($this->source_id)) {
            $this->source_id = array($this->source_id);
        }
Severity: Minor
Found in fannie/classlib2.0/item/FannieSignage.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 drawPDF has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function drawPDF()
    {
        $pdf = new \FPDF('P', 'mm', 'Letter');

        $pdf->SetTopMargin($this->top);  //Set top margin of the page
Severity: Minor
Found in fannie/classlib2.0/item/signage/TagsNoPrice.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 drawPDF has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function drawPDF()
    {
        $pdf = new \FPDF('P', 'mm', 'Letter');

        $pdf->SetTopMargin($this->top);  //Set top margin of the page
Severity: Minor
Found in fannie/classlib2.0/item/signage/Tags4x8P.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 calculateMargin has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function calculateMargin($price, $cost, $deptID, $upc)
    {
        $dbc = $this->db();

        $desired_margin = 'Unknown';
Severity: Minor
Found in fannie/item/modules/ItemMarginModule.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 SaveFormData has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function SaveFormData($upc)
    {
        $upc = BarcodeLib::padUPC($upc);
        $brand = FormLib::get('lf_brand');
        $desc = FormLib::get('lf_desc');
Severity: Minor
Found in fannie/item/modules/ProdUserModule.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 getNewItem has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function getNewItem($upc)
    {
        $dbc = $this->db();
        // default values for form fields
        $rowItem = array(
Severity: Minor
Found in fannie/item/modules/BaseItemModule.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 16 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in fannie/item/multistore/IncompleteItemsPage.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 writeLog has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function writeLog($message, array $context, $intLevel)
    {
        $trace = debug_backtrace();
        $file = $this->getLogLocation($intLevel);
        $verboseDebug = $this->verboseDebugging();
Severity: Minor
Found in common/BaseLogger.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 load has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function load()
    {
        if (empty($this->unique)) {
            return false;
        }
Severity: Minor
Found in common/BasicModel.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 __call has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function __call($name, $arguments)
    {
        if (!isset($this->columns[$name])) {
            foreach ($this->columns as $col => $info) {
                if (isset($info['replaces']) && $info['replaces'] == $name) {
Severity: Minor
Found in common/BasicModel.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

Method TryParseDateIso has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
Open

        internal static bool TryParseDateIso(string text, DateParseHandling dateParseHandling, DateTimeZoneHandling dateTimeZoneHandling, out object dt)
        {
            DateTimeParser dateTimeParser = new DateTimeParser();
            if (!dateTimeParser.Parse(text))
            {

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

        unsafe void WriteThread()
        {
            if (!HandleAcquire()) { return; }
            
            try

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