Showing 1,039 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
The class CorePage has 26 non-getter- and setter-methods. Consider refactoring CorePage to keep number of methods under 25. Open
class CorePage
{
public $description = "
Base class for creating HTML pages.
";
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class CorePage has an overall complexity of 50 which is very high. The configured complexity threshold is 50. Open
class CorePage
{
public $description = "
Base class for creating HTML pages.
";
- Exclude checks
The class SQLManager has 74 non-getter- and setter-methods. Consider refactoring SQLManager to keep number of methods under 25. Open
class SQLManager
{
private $QUERY_LOG;
/** Array of connections **/
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class SQLManager has 66 public methods. Consider refactoring SQLManager to keep number of public methods under 10. Open
class SQLManager
{
private $QUERY_LOG;
/** Array of connections **/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class SQLManager has an overall complexity of 287 which is very high. The configured complexity threshold is 50. Open
class SQLManager
{
private $QUERY_LOG;
/** Array of connections **/
- Exclude checks
The class BasicModel has 20 public methods. Consider refactoring BasicModel to keep number of public methods under 10. Open
class BasicModel
{
/**
Name of the table
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class BasicModel has an overall complexity of 317 which is very high. The configured complexity threshold is 50. Open
class BasicModel
{
/**
Name of the table
*/
- Exclude checks
The class BasicModel has 35 non-getter- and setter-methods. Consider refactoring BasicModel to keep number of methods under 25. Open
class BasicModel
{
/**
Name of the table
*/
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class PgsqlAdapter has 19 public methods. Consider refactoring PgsqlAdapter to keep number of public methods under 10. Open
class PgsqlAdapter implements DialectAdapter
{
public function createNamedDB($name)
{
return 'CREATE SCHEMA ' . $this->identifierEscape($name);
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class MssqlAdapter has 19 public methods. Consider refactoring MssqlAdapter to keep number of public methods under 10. Open
class MssqlAdapter implements DialectAdapter
{
public function createNamedDB($name)
{
return 'CREATE DATABASE ' . $this->identifierEscape($name);
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class MysqlAdapter has 19 public methods. Consider refactoring MysqlAdapter to keep number of public methods under 10. Open
class MysqlAdapter implements DialectAdapter
{
public function createNamedDB($name)
{
return 'CREATE DATABASE ' . $this->identifierEscape($name);
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example