CORE-POS/IS4C

View on GitHub
pos/is4c-nf/lib/LocalStorage/CoreLocal.php

Summary

Maintainability
B
5 hrs
Test Coverage
F
38%

Function migrateSettings has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static function migrateSettings()
    {
        if (file_exists(dirname(__FILE__).'/../../ini.php')) {
            $file = dirname(__FILE__).'/../../ini.php';
            $settings = self::readIniPhp();
Severity: Minor
Found in pos/is4c-nf/lib/LocalStorage/CoreLocal.php - About 3 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 loadIni has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static function loadIni()
    {
        /**
          UnitTestStorage is backed by a simple array rather
          than $_SESSION. This loads the ini.php settings into
Severity: Minor
Found in pos/is4c-nf/lib/LocalStorage/CoreLocal.php - About 45 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 validateJsonIni has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateJsonIni()
    {
        $json = dirname(__FILE__) . '/../../ini.json';
        $settings = array();
        if (!file_exists($json) && !is_writable(dirname(__FILE__) . '/../../')) {
Severity: Minor
Found in pos/is4c-nf/lib/LocalStorage/CoreLocal.php - About 45 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 readIniJson has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function readIniJson()
    {
        $json = dirname(__FILE__) . '/../../ini.json';
        $ret = new \COREPOS\pos\lib\LocalStorage\UnitTestStorage();
        if (file_exists($json)) {
Severity: Minor
Found in pos/is4c-nf/lib/LocalStorage/CoreLocal.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

There are no issues that match your filters.

Category
Status