Function validateRecursive
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function validateRecursive($propertyName, $filterName, $filterArgs = null)
{
// check if we got it from form defined request method
if (App::$Request->getMethod() !== $this->_sendMethod) {
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 runValidate
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function runValidate(array $rules = null)
{
// skip validation on empty rules
if ($rules === null) {
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 validateRecursive
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateRecursive($propertyName, $filterName, $filterArgs = null)
{
// check if we got it from form defined request method
if (App::$Request->getMethod() !== $this->_sendMethod) {
return false;
Function getRequest
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getRequest($param, $method = null)
{
if ($method === null) {
$method = $this->_sendMethod;
}
- 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 getRequest
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRequest($param, $method = null)
{
if ($method === null) {
$method = $this->_sendMethod;
}
Method runValidate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runValidate(array $rules = null)
{
// skip validation on empty rules
if ($rules === null) {
return true;
Function initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function initialize($csrf = false)
{
$this->_tokenRequired = $csrf;
if ($csrf) {
// get current token value from session
- 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 getFieldValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getFieldValue($propertyName)
{
// get type of input data (where we must look it up)
$inputType = Str::lowerCase($this->_sendMethod);
$filterType = 'text';
- 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"