Showing 59 of 59 total issues
Method getModels
has 31 lines of code (exceeds 30 allowed). Consider refactoring. Open
Open
public function getModels(Connection $connection, array $config) : array
{
$baseModel = $config['model'];
$allowedModels = isset($config['allow']) ? $config['allow'] : [];
$baseHumanName = $this->getHumanName($allowedModels, $baseModel);
Function getModels
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getModels(Connection $connection, array $config) : array
{
$baseModel = $config['model'];
$allowedModels = isset($config['allow']) ? $config['allow'] : [];
$baseHumanName = $this->getHumanName($allowedModels, $baseModel);
- 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
There must not be more than one property declared per statement Open
Open
private $config,
- Exclude checks
Blank line found at start of control structure Open
Open
foreach ($columns as $column) {
- Exclude checks
Function getOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
private function getOptions(array $options) : array
{
$return = [];
$keys = array_keys($options);
- 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
Expected 0 spaces before closing bracket; 1 found Open
Open
if( Configure::read('debug') == false ){
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
Open
$dotNotations = array_filter($dots, function($dot){
- Exclude checks
Blank line found at start of control structure Open
Open
for ($i = 0; $i < $length; $i++) {
- Exclude checks
Blank line found at start of control structure Open
Open
foreach ($data as $item) {
- Exclude checks
Property name "$_defaultCode" should not be prefixed with an underscore to indicate visibility Open
Open
protected $_defaultCode = 500;
- Exclude checks
Property name "$_defaultConfig" should not be prefixed with an underscore to indicate visibility Open
Open
protected $_defaultConfig = [
- Exclude checks
Property name "$_defaultCode" should not be prefixed with an underscore to indicate visibility Open
Open
protected $_defaultCode = 500;
- Exclude checks
Expected 1 space before opening brace; found 0 Open
Open
$dotNotations = array_filter($dots, function($dot){
- Exclude checks
There must not be more than one property declared per statement Open
Open
private $models = false,
- Exclude checks
Property name "$_defaultCode" should not be prefixed with an underscore to indicate visibility Open
Open
protected $_defaultCode = 500;
- Exclude checks
Blank line found at start of control structure Open
Open
foreach ($model['columns'] as $column => $field) {
- Exclude checks
Blank line found at start of control structure Open
Open
foreach ($options as $key => $option) {
- Exclude checks
Blank line found at start of control structure Open
Open
foreach ($paths as $path) {
- Exclude checks
There must not be more than one property declared per statement Open
Open
private $model,
- Exclude checks
Avoid too many return
statements within this method. Open
Open
return [];