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();
- Read upRead up
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
- Read upRead up
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__) . '/../../')) {
- Read upRead up
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)) {
- Read upRead up
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"