Showing 127 of 140 total issues
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct(BackendSingletonContainer $container, ImageFile $file)
{
$this->container = $container;
parent::__construct($container, $file);
$this->whitelistType('ImageFile');
- Create a ticketCreate a ticket
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct(BackendSingletonContainer $container, Page $page)
{
$this->container = $container;
parent::__construct($page, 'Page');
$this->whitelistFunction('Page',
- Create a ticketCreate a ticket
Method __construct
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(BackendSingletonContainer $container, $id = "")
{
$connection = $container->getDBInstance()->getConnection();
$this->container = $container;
parent::__construct(
- Create a ticketCreate a ticket
Function evaluate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function evaluate(&$message = "", &$status = "")
{
if (!isset($_POST['username'], $_POST['password'])) {
return 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
Function canHandle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function canHandle($type, JSONFunction $function, $instance = null)
{
if (isset($this->alias[$type])) {
$canHandle = false;
foreach ($this->alias[$type] as $target) {
- 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 __construct
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct(BackendSingletonContainer $container, UserPrivileges $privileges)
{
$this->container = $container;
parent::__construct($privileges);
- Create a ticketCreate a ticket
Method parametersCheck
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parametersCheck(array $functionArgs, array $parameters)
{
$numReqParam = 0;
- Create a ticketCreate a ticket
Method relativeToAbsolute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function relativeToAbsolute($file,$currentWorkingDir = null)
{
if($currentWorkingDir == null){
$currentWorkingDir = getcwd();
}
- Create a ticketCreate a ticket
Method generateContent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateContent()
{
parent::generateContent();
$latest= null;
$pageContent = new PageContentImpl($this->container, $this->container->getCurrentPageStrategyInstance()->getCurrentPage(), "mainContent");
- Create a ticketCreate a ticket
Method update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update()
{
$this->setUpVersion();
$connection = $this->getConnection();
foreach ($this->folders as $name => $path) {
- Create a ticketCreate a ticket
Method evaluate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function evaluate(&$message = "", &$status = "")
{
if (!isset($_POST['username'], $_POST['password'])) {
return false;
}
- Create a ticketCreate a ticket
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function __construct(DB $database,
Observable $observable,
$param_name,
callable $update_param,
callable $set_check,
- Create a ticketCreate a ticket
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 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
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
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 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 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 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