Showing 127 of 140 total issues
Function validValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function validValue(&$val)
{
if (!is_array($val)) {
return $val == null || is_scalar($val) || $val instanceof JsonSerializable;
}
- Read upRead up
- Create a ticketCreate a ticket
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 relativePath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function relativePath($path,$relative,$currentWorkingDir = null)
{
if($currentWorkingDir == null){
$currentWorkingDir = getcwd();
}
- Read upRead up
- Create a ticketCreate a ticket
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 listPagePrivileges
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function listPagePrivileges(PageOrder $pageOrder = null)
{
$this->initialize();
if ($this->hasRootPrivileges() || $this->hasSitePrivileges()) {
return array();
- Read upRead up
- Create a ticketCreate a ticket
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 internalHandleArguments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function internalHandleArguments(JSONFunction $function)
{
$args = [];
foreach ($function->getArgs() as $arg) {
if (!($arg instanceof Program)) {
- Read upRead up
- Create a ticketCreate a ticket
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 deleteUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function deleteUser(User $user)
{
$parent = $user->getParent();
if (!isset($this->userList[$user->getUsername()]) || $this->userList[$user->getUsername()] !== $user ||
$parent == null
- Read upRead up
- Create a ticketCreate a ticket
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 removeIDFromSubLists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function removeIDFromSubLists($pageID)
{
foreach ($this->pageOrder as $parent_id => $orderArray) {
foreach ($orderArray as $order => $page_id) {
if ($page_id == $pageID) {
- Read upRead up
- Create a ticketCreate a ticket
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 setUpTwig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function setUpTwig(Twig_LoaderInterface $loader, $renderTarget)
{
$fsLoader = new Twig_Loader_Filesystem();
foreach($this->config->listTemplateFolders() as $folder){
- Read upRead up
- Create a ticketCreate a ticket
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"