CORE-POS/IS4C

View on GitHub
fannie/classlib2.0/data/ordering/ExponentialLeastSquares.php

Summary

Maintainability
C
7 hrs
Test Coverage
F
0%

Method updatePars has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function updatePars($dbc, $vendorID, $deptID, $storeID, $json)
    {
        $dlog = FannieConfig::config('TRANS_DB') . $dbc->sep() . 'dlog_15';
        $today = date('Y-m-d 00:00:00');

Severity: Major
Found in fannie/classlib2.0/data/ordering/ExponentialLeastSquares.php - About 3 hrs to fix

    Function updatePars has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function updatePars($dbc, $vendorID, $deptID, $storeID, $json)
        {
            $dlog = FannieConfig::config('TRANS_DB') . $dbc->sep() . 'dlog_15';
            $today = date('Y-m-d 00:00:00');
    
    
    Severity: Minor
    Found in fannie/classlib2.0/data/ordering/ExponentialLeastSquares.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 renderParams has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function renderParams($json)
        {
            if (!isset($json['loss'])) {
                $json['loss'] = 0;
            }
    Severity: Minor
    Found in fannie/classlib2.0/data/ordering/ExponentialLeastSquares.php - About 1 hr to fix

      Method updatePars has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function updatePars($dbc, $vendorID, $deptID, $storeID, $json)
      Severity: Minor
      Found in fannie/classlib2.0/data/ordering/ExponentialLeastSquares.php - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status