budde377/Part

View on GitHub

Showing 127 of 140 total issues

Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(BackendSingletonContainer $container, PageOrderImpl $pageOrder, $id, $title, $template, $alias, $lastModified, $hidden)
Severity: Major
Found in lib/model/page/PageImpl.php - About 1 hr to fix

Method sendMail has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function sendMail($from, $to, $subject, $message, $cc, $bcc, $additionalHeaders = array())
Severity: Major
Found in lib/util/mail/RealSendMailStrategyImpl.php - About 50 mins to fix

Method sendMail has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function sendMail($from,$to, $subject, $message,$cc,$bcc,$additionalHeaders= array());
Severity: Major
Found in lib/util/mail/SendMailStrategy.php - About 50 mins to fix

Function uploadImageFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function uploadImageFile()
    {
        return function (FileLibrary $library, array $fileArray, array $sizes) {
            //TODO test
            $file = $library->uploadToLibrary($this->container->getUserLibraryInstance()->getUserLoggedIn(), $fileArray);
Severity: Minor
Found in lib/controller/ajax/type_handler/FileLibraryTypeHandlerImpl.php - About 45 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 expectFunctionChain has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function expectFunctionChain()
    {
        if ($this->look_ahead == Lexer::T_DOT) {
            $this->match(Lexer::T_DOT);
            $name = $this->expectName();
Severity: Minor
Found in lib/controller/function_string/ParserImpl.php - About 45 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 expectArrayEntry has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function expectArrayEntry()
    {
        switch ($this->look_ahead) {
            case Lexer::T_NAME:
            case Lexer::T_NAME_NOT_STARTING_WITH_UNDERSCORE:
Severity: Minor
Found in lib/controller/function_string/ParserImpl.php - About 45 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

Method createPageInstance has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private function createPageInstance($id, $title, $template, $alias, $lastMod, $hidden)
Severity: Minor
Found in lib/model/page/PageOrderImpl.php - About 45 mins to fix

Function relativeToAbsolute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function relativeToAbsolute($file,$currentWorkingDir = null)
    {
        if($currentWorkingDir == null){
            $currentWorkingDir = getcwd();
        }
Severity: Minor
Found in lib/util/traits/FilePathTrait.php - About 45 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

Method crop has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function crop($x, $y, $width, $height, $saveAsNewFile = false);
Severity: Minor
Found in lib/util/file/ImageFile.php - About 35 mins to fix

Method crop has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function crop($x, $y, $width, $height, $saveAsNewFile = false)
Severity: Minor
Found in lib/util/file/ImageFileImpl.php - About 35 mins to fix

Method createPage has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function createPage($id, $title='', $template = '', $alias = '', $hidden = false);
Severity: Minor
Found in lib/model/page/PageOrder.php - About 35 mins to fix

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(BackendSingletonContainer $container, $id,$title,$template,$alias = null)
Severity: Minor
Found in lib/model/page/DefaultPageImpl.php - About 35 mins to fix

Method crop has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function crop($x, $y, $width, $height, $saveAsNewFile = false)
Severity: Minor
Found in lib/util/file/TypeHandlerGeneratorImageFileImpl.php - About 35 mins to fix

Method createPage has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function createPage($id, $title = '', $template = '', $alias = '', $hidden = false)
Severity: Minor
Found in lib/model/page/PageOrderImpl.php - About 35 mins to fix

Function clean has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function clean()
    {
        foreach($this->listFolder() as $f){
            if($f instanceof Folder){
                $f->delete(Folder::DELETE_FOLDER_RECURSIVE);
Severity: Minor
Found in lib/util/file/FolderImpl.php - About 35 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 wrapperHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function wrapperHandler($input, $token)
    {

        if (!$this->container->getUserLibraryInstance()->verifyUserSessionToken($token)) {
            return new ResponseImpl(Response::RESPONSE_TYPE_ERROR, Response::ERROR_CODE_UNAUTHORIZED);
Severity: Minor
Found in lib/controller/ajax/ServerImpl.php - About 35 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 listFunctions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function listFunctions($type)
    {
        if (!$this->hasType($type)) {
            return array();
        }
Severity: Minor
Found in lib/controller/ajax/type_handler/GenericObjectTypeHandlerImpl.php - About 35 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 listTemplateFolders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function listTemplateFolders()
    {

        $this->setUpTemplate();
        $result = [];
Severity: Minor
Found in lib/ConfigImpl.php - About 35 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 recursiveCalculatePath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function recursiveCalculatePath(Page $page, Page $parent = null)
    {
        $order = $this->getPageOrder($parent);
        foreach ($order as $p) {
            /** @var $p Page */
Severity: Minor
Found in lib/model/page/PageOrderImpl.php - About 35 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 updatePageOrderId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function updatePageOrderId($oldId, $newId)
    {
        if (isset($this->pageOrder[$oldId])) {
            $this->pageOrder[$newId] = $this->pageOrder[$oldId];
            unset($this->pageOrder[$oldId]);
Severity: Minor
Found in lib/model/page/PageOrderImpl.php - About 35 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