Showing 84 of 1,039 total issues
Function load
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function load()
{
if (empty($this->unique)) {
return false;
}
- 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 normalizeRename
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function normalizeRename($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
{
$current = $this->connection->detailedDefinition($this->name);
$recase_columns = array();
foreach ($this->columns as $col_name => $definition) {
- 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 save
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
if (!is_array($this->hooks) || empty($this->hooks)) {
$this->loadHooks();
}
- 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 writeLog
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function writeLog($message, array $context, $intLevel)
{
$file = $this->getLogLocation($intLevel);
$verboseDebug = $this->verboseDebugging();
- 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 __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) {
- 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
Method create
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create()
{
if ($this->connection->tableExists($this->fq_name)) {
return true;
}
Function arrayToSQL
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function arrayToSQL($definition, $dbms)
{
$sql = '';
$type = $definition['type'];
if (isset($this->meta_types[strtoupper($type)])) {
- 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
Method printMarkdown
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function printMarkdown($files)
{
$tables = array();
$tables = array_reduce($files,
function ($carry, $file) {
Method normalizeColumnAttributes
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function normalizeColumnAttributes($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
{
$current = $this->connection->detailedDefinition($this->name);
$recase_columns = array();
$redo_pk = false;
Method transfer
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function transfer($source_db,$select_query,$dest_db,$insert_query)
{
$result = $this->query($select_query,$source_db);
if (!$result) {
return false;
Function normalizeChangeCase
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function normalizeChangeCase($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
{
$current = $this->connection->detailedDefinition($this->name);
$lowercase_current = array();
$casemap = array();
- 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 transfer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function transfer($source_db,$select_query,$dest_db,$insert_query)
{
$result = $this->query($select_query,$source_db);
if (!$result) {
return false;
- 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
Method save
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save()
{
if (!is_array($this->hooks) || empty($this->hooks)) {
$this->loadHooks();
}
Method drawPage
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function drawPage()
{
$this->preFlight();
if ($this->preprocess()) {
Method load
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load()
{
if (empty($this->unique)) {
return false;
}
Function drawPage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function drawPage()
{
$this->preFlight();
if ($this->preprocess()) {
- 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
Method normalizeChangeCase
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function normalizeChangeCase($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
{
$current = $this->connection->detailedDefinition($this->name);
$lowercase_current = array();
$casemap = array();
Method unitTest
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function unitTest($phpunit)
{
$this->__routes = array(
'get',
'get<id>',
Method insertRecord
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function insertRecord()
{
$sql = 'INSERT INTO '.$this->fq_name;
$cols = '(';
$vals = '(';
Method updateRecord
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateRecord()
{
$sql = 'UPDATE '.$this->fq_name;
$sets = '';
$where = '1=1';