Showing 140 of 140 total issues
Avoid too many return
statements within this method. Open
return $this->parseDecoded($f);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $this->getCurrentPageStrategyInstance();
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return new ResponseImpl();
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $this->getUserLibraryInstance();
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return new OctalUnsignedNumScalarImpl($n);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $result;
- Create a ticketCreate a ticket
Function whitelistType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function whitelistType($type)
{
foreach (func_get_args() as $arg) {
if (!in_array($arg, $this->types)) {
continue;
- 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 getFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getFile()
{
return function (FileLibrary $library, $file_name) {
$file = new FileImpl($library->getFilesFolder()->getAbsolutePath().'/'.$file_name);
- 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 cleanLibrary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function cleanLibrary(User $user = null)
{
foreach($this->getFileList($user) as $file){
/** @var $file File */
if(!$this->whitelistContainsFile($file)){
- 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 generateSite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function generateSite()
{
$template = new TemplateImpl($this->backendContainer);
$pageStrategy = $this->backendContainer->getCurrentPageStrategyInstance();
- 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 listLog
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function listLog($level = Logger::LOG_LEVEL_ALL, $includeContext = true, $time = 0)
{
$list = $this->logFile->listLog($level, $time);
$result = [];
foreach ($list as $entry) {
- 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 getFileList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getFileList(User $user = null)
{
$returnList = array();
if($user != null){
$folder = new FolderImpl($this->filesDir->getAbsolutePath()."/".$user->getUniqueId());
- 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 checkForUpdates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function checkForUpdates($quick = false)
{
if (!$this->subModuleUpdater) {
$this->site->getVariables()->setValue("last_checked", time());
- 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 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"