budde377/Part

View on GitHub

Showing 127 of 140 total issues

Avoid too many return statements within this method.
Open

        return $this->dynamicInstances[$name];
Severity: Major
Found in lib/BackendSingletonContainerImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

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

Avoid too many return statements within this method.
Open

        return $page;
Severity: Major
Found in lib/model/page/PageOrderImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $page == null?[]:[$page];
Severity: Major
Found in lib/model/page/CurrentPageStrategyImpl.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

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

Avoid too many return statements within this method.
Open

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

Avoid too many return statements within this method.
Open

                return $response;
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->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

Severity
Category
Status
Source
Language