budde377/Part

View on GitHub

Showing 140 of 140 total issues

Avoid too many return statements within this method.
Open

                    return $this->parseDecoded($f);
Severity: Major
Found in lib/controller/json/ParserImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->getCurrentPageStrategyInstance();
Severity: Major
Found in lib/BackendSingletonContainerImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return new ResponseImpl();
Severity: Major
Found in lib/controller/ajax/type_handler/UserTypeHandlerImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->getUserLibraryInstance();
Severity: Major
Found in lib/BackendSingletonContainerImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return new OctalUnsignedNumScalarImpl($n);
Severity: Major
Found in lib/controller/function_string/ParserImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $result;
Severity: Major
Found in lib/controller/ajax/type_handler/GenericObjectTypeHandlerImpl.php - About 30 mins to fix

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;
Severity: Minor
Found in lib/controller/ajax/type_handler/GenericObjectTypeHandlerImpl.php - About 25 mins to fix

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);
Severity: Minor
Found in lib/controller/ajax/type_handler/FileLibraryTypeHandlerImpl.php - About 25 mins to fix

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)){
Severity: Minor
Found in lib/util/file/FileLibraryImpl.php - About 25 mins to fix

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();
Severity: Minor
Found in lib/WebsiteImpl.php - About 25 mins to fix

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) {
Severity: Minor
Found in lib/log/LoggerImpl.php - About 25 mins to fix

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());
Severity: Minor
Found in lib/util/file/FileLibraryImpl.php - About 25 mins to fix

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());
Severity: Minor
Found in lib/model/updater/GitUpdaterImpl.php - About 25 mins to fix

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;
        }
Severity: Minor
Found in lib/controller/json/ElementImpl.php - About 25 mins to fix

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();
        }
Severity: Minor
Found in lib/util/traits/FilePathTrait.php - About 25 mins to fix

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();
Severity: Minor
Found in lib/model/user/UserPrivilegesImpl.php - About 25 mins to fix

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)) {
Severity: Minor
Found in lib/controller/ajax/ServerImpl.php - About 25 mins to fix

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
Severity: Minor
Found in lib/model/user/UserLibraryImpl.php - About 25 mins to fix

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) {
Severity: Minor
Found in lib/model/page/PageOrderImpl.php - About 25 mins to fix

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){

Severity: Minor
Found in lib/view/template/TemplateImpl.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language