budde377/Part

View on GitHub

Showing 127 of 140 total issues

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