Showing 84 of 1,039 total issues
File BasicModel.php
has 1065 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op
File SQLManager.php
has 1032 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2009 Whole Foods Co-op
SQLManager
has 91 functions (exceeds 20 allowed). Consider refactoring. Open
class SQLManager
{
private $QUERY_LOG;
/** Array of connections **/
Function normalize
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
public function normalize($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
{
if ($mode != BasicModel::NORMALIZE_MODE_CHECK && $mode != BasicModel::NORMALIZE_MODE_APPLY) {
echo "Error: Unknown mode ($mode)\n";
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
BasicModel
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
class BasicModel
{
/**
Name of the table
*/
CorePage
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class CorePage
{
public $description = "
Base class for creating HTML pages.
";
Method normalize
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalize($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
{
if ($mode != BasicModel::NORMALIZE_MODE_CHECK && $mode != BasicModel::NORMALIZE_MODE_APPLY) {
echo "Error: Unknown mode ($mode)\n";
return false;
Function find
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function find($sort='', $reverse=false)
{
if (!is_array($sort)) {
$sort = array($sort);
}
- 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 cli
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function cli($argc, $argv)
{
if ($argc > 2 && $argv[1] == '--doc') {
array_shift($argv);
array_shift($argv);
- 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 normalizeColumnAttributes
has a Cognitive Complexity of 22 (exceeds 5 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;
- 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 insertRecord
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function insertRecord()
{
$sql = 'INSERT INTO '.$this->fq_name;
$cols = '(';
$vals = '(';
- 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 create
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function create()
{
if ($this->connection->tableExists($this->fq_name)) {
return true;
}
- 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 cli
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cli($argc, $argv)
{
if ($argc > 2 && $argv[1] == '--doc') {
array_shift($argv);
array_shift($argv);
Function readRoutes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function readRoutes()
{
// routes begin with method
$this->__method = $this->detectMethod();
- 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 find
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function find($sort='', $reverse=false)
{
if (!is_array($sort)) {
$sort = array($sort);
}
PgsqlAdapter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class PgsqlAdapter implements DialectAdapter
{
public function createNamedDB($name)
{
return 'CREATE SCHEMA ' . $this->identifierEscape($name);
MysqlAdapter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class MysqlAdapter implements DialectAdapter
{
public function createNamedDB($name)
{
return 'CREATE DATABASE ' . $this->identifierEscape($name);
SqliteAdapter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class SqliteAdapter implements DialectAdapter
{
public function createNamedDB($name)
{
return 'SELECT 1';
MssqlAdapter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class MssqlAdapter implements DialectAdapter
{
public function createNamedDB($name)
{
return 'CREATE DATABASE ' . $this->identifierEscape($name);
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"