Method get_view
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_view()
{
$obj = $this->getCRUDModel();
$id_col = $this->getIdCol();
$columns = $obj->getColumns();
Function get_view
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function get_view()
{
$obj = $this->getCRUDModel();
$id_col = $this->getIdCol();
$columns = $obj->getColumns();
- 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
File FannieCRUDPage.php
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2015 Whole Foods Co-op
Method post_id_handler
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post_id_handler()
{
if (!is_array($this->id)) {
return $this->unknownRequestHandler();
}
Method getCRUDModel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getCRUDModel()
{
if ($this->model === null) {
$class_name = $this->model_name;
$this->model = new $class_name($this->connection);
Function put_handler
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function put_handler()
{
$obj = $this->getCRUDModel();
$id_col = $this->getIdCol();
$columns = $obj->getColumns();
- 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 put_handler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function put_handler()
{
$obj = $this->getCRUDModel();
$id_col = $this->getIdCol();
$columns = $obj->getColumns();
Function getCRUDModel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getCRUDModel()
{
if ($this->model === null) {
$class_name = $this->model_name;
$this->model = new $class_name($this->connection);
- 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 getIdCol
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getIdCol()
{
$pks = array();
$obj = $this->getCRUDModel();
foreach ($obj->getColumns() as $name => $c) {
- 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 findPlaceholder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function findPlaceholder($columns, $id_col)
{
foreach ($columns as $col_name => $c) {
if ($col_name != $id_col && strstr(strtoupper($c['type']), 'CHAR')) {
return array($col_name, 'NEW');
- 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 post_id_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function post_id_handler()
{
if (!is_array($this->id)) {
return $this->unknownRequestHandler();
}
- 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"