Showing 140 of 140 total issues
Function onChange
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function onChange(Observable $subject, $changeType)
{
switch ($changeType) {
case User::EVENT_DELETE:
if ($subject instanceof User) {
- 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 buildTaskQueue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function buildTaskQueue(BackendSingletonContainer $container, $scriptArray)
{
$chain = new TaskQueueImpl();
foreach ($scriptArray as $className => $location) {
- 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 setPageOrder
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function setPageOrder(Page $page, $place = PageOrder::PAGE_ORDER_LAST, Page $parentPage = null)
{
if ($parentPage instanceof Page) {
if ($this->findPage($parentPage) !== false) {
- 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
Method handle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle($type, JSONFunction $function, $instance = null)
{
if (isset($this->alias[$type])) {
foreach ($this->alias[$type] as $target) {
if (!$this->canHandle($target, $function, $instance)) {
- Create a ticketCreate a ticket
Method privateRender
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function privateRender(array $context, $initialize = false)
{
$userLib = $this->backendContainer->getUserLibraryInstance();
$currentPageStrat = $this->backendContainer->getCurrentPageStrategyInstance();
$this->pageElementFactory->clearCache();
- Create a ticketCreate a ticket
Method setUp
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp(Server $server, $type)
{
if (in_array($type, $this->hasBeenSetUp)) {
return;
- Create a ticketCreate a ticket
Method getPageElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPageElement($name, $cached = true)
{
if($cached && isset($this->cache[$name])){
return $this->cache[$name];
}
- Create a ticketCreate a ticket
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$id,
callable $modifyStrategy,
PDOStatement $addContentStm,
PDOStatement $latestContentStm,
PDOStatement $listContentHistStm,
- Create a ticketCreate a ticket
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(BackendSingletonContainer $container, PageOrderImpl $pageOrder, $id, $title, $template, $alias, $lastModified, $hidden)
- Create a ticketCreate a ticket
Method sendMail
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function sendMail($from,$to, $subject, $message,$cc,$bcc,$additionalHeaders= array());
- Create a ticketCreate a ticket
Method sendMail
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function sendMail($from, $to, $subject, $message, $cc, $bcc, $additionalHeaders = array())
- Create a ticketCreate a ticket
Function expectFunctionChain
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function expectFunctionChain()
{
if ($this->look_ahead == Lexer::T_DOT) {
$this->match(Lexer::T_DOT);
$name = $this->expectName();
- 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
Method createPageInstance
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function createPageInstance($id, $title, $template, $alias, $lastMod, $hidden)
- Create a ticketCreate a ticket
Function expectArrayEntry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function expectArrayEntry()
{
switch ($this->look_ahead) {
case Lexer::T_NAME:
case Lexer::T_NAME_NOT_STARTING_WITH_UNDERSCORE:
- 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 relativeToAbsolute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function relativeToAbsolute($file,$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 uploadImageFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function uploadImageFile()
{
return function (FileLibrary $library, array $fileArray, array $sizes) {
//TODO test
$file = $library->uploadToLibrary($this->container->getUserLibraryInstance()->getUserLoggedIn(), $fileArray);
- 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
Method crop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function crop($x, $y, $width, $height, $saveAsNewFile = false)
- Create a ticketCreate a ticket
Method createPage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createPage($id, $title='', $template = '', $alias = '', $hidden = false);
- Create a ticketCreate a ticket
Method crop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function crop($x, $y, $width, $height, $saveAsNewFile = false)
- Create a ticketCreate a ticket
Method crop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function crop($x, $y, $width, $height, $saveAsNewFile = false);
- Create a ticketCreate a ticket