CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    private function receiveOrderedItem($dbc, $model)
    {
        echo '<table class="table table-bordered small">';
        $uid = FannieAuth::getUID($this->current_user);
        if (!is_array($model)) {
Severity: Minor
Found in fannie/purchasing/ViewPurchaseOrders.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_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_handler()
    {
        $url = $this->config->get('MEMBER_URL');
        if ($url == '') {
            $url = 'mem/MemberEditor.php';
Severity: Minor
Found in fannie/mem/MemRedirect.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 GetSearchResults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function GetSearchResults()
    {
        $FANNIE_MEMBER_UPC_PREFIX = FannieConfig::config('FANNIE_MEMBER_UPC_PREFIX');
        $dbc = $this->db();

Severity: Minor
Found in fannie/mem/modules/MemCard.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()
    {
        if (FormLib::get_form_value('createMems',False) !== false) {
            if (!is_numeric(FormLib::get_form_value('memtype'))) {
                $this->errors = "<i>Error: member type wasn't set correctly</i>";   
Severity: Minor
Found in fannie/mem/NewMemberTool.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()
    {
        if (!is_array($this->id)) {
            return $this->unknownRequestHandler();
        }
Severity: Minor
Found in fannie/classlib2.0/FannieCRUDPage.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

    public function check()
    {
        $ret = array();
        foreach ($this->config->get('LANES') as $lane) {
            // verify lane is online
Severity: Minor
Found in fannie/classlib2.0/monitor/LaneMonitor.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 getFromDB has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getFromDB()
    {
        $ret = array();
        $keys = array_keys($this->plugin_settings);
        if (strlen($this->settingsNamespace) > 0) {
Severity: Minor
Found in fannie/classlib2.0/FanniePlugin.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 show_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function show_content()
    {
        global $FANNIE_PRETTY_LOGS, $FANNIE_URL, $FANNIE_LOG_LIMIT;

        $fn = base64_decode(FormLib::get_form_value('logfile'));
Severity: Minor
Found in fannie/logs/LogViewer.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 userAuthRange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static private function userAuthRange($name, $auth_class)
    {
        if (self::initCheck()) {
            return 'all';
        }
Severity: Minor
Found in fannie/classlib2.0/auth/FannieAuth.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 validateData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function validateData($dbc)
    {
        if (!$this->checkData()) {
            return false;
        }
Severity: Minor
Found in fannie/classlib2.0/jobs/SqlUpdate.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $config = FannieConfig::factory();
        $dbc = FannieDB::get($config->get('OP_DB'));

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

    static public function checkLogin()
    {
        if (!self::enabled()) {
            return 'null';
        }
Severity: Minor
Found in fannie/classlib2.0/auth/FannieAuth.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 groupAuthRange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static private function groupAuthRange($username, $auth_class)
    {
        if (self::initCheck()) {
            return 'all';
        }
Severity: Minor
Found in fannie/classlib2.0/auth/FannieAuth.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 forceStopBatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function forceStopBatch($id)
    {
        // verify limit columns exist
        $b_def = $this->connection->tableDefinition($this->name);
        $p_def = $this->connection->tableDefinition('products');
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 parameterize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function parameterize($arr, $datecol='', $datefunc='')
    {
        $columns = !empty($datecol) && !empty($datefunc) ? $datecol.',' : '';
        $values = !empty($datecol) && !empty($datefunc) ? $datefunc.',' : '';
        $args = array();
Severity: Minor
Found in fannie/classlib2.0/data/DTrans.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 hookAddColumnsalesCode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function hookAddColumnsalesCode()
    {
        if ($this->connection->table_exists('deptSalesCodes')) {
            $dataR = $this->connection->query('SELECT dept_ID, salesCode FROM deptSalesCodes');
            $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 getLocalOrigins has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getLocalOrigins()
    {
        $def = $this->connection->tableDefinition('origins');
        $ret = array();
        if (isset($def['shortName'])) {
Severity: Minor
Found in fannie/classlib2.0/data/models/op/OriginsModel.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 addColumnFromDefaults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addColumnFromDefaults($defaultCol, $myCol)
    {
        if ($this->connection->tableExists('memdefaults')) {
            $dataR = $this->connection->query("SELECT memtype, {$defaultCol} FROM memdefaults");
            $tempModel = new MemtypeModel($this->connection);
Severity: Minor
Found in fannie/classlib2.0/data/models/op/MemtypeModel.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 normalize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function normalize($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK, $doCreate=false)
    {
        // don't try to detect a db structure corresponding to
        // the ViewModel class itself
        if ($this->name == '__VirtualClass_ShouldNotExist') {
Severity: Minor
Found in fannie/classlib2.0/data/models/ViewModel.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 calculateVariableCheckDigit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static private function calculateVariableCheckDigit($upc)
    {
        $sum = 0;
        for ($i=0; $i<strlen($upc); $i++) {
            if ($i % 2 == 0) {
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

Severity
Category
Status
Source
Language