budde377/Part

View on GitHub

Showing 140 of 140 total issues

Function onChange has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function onChange(Observable $subject, $changeType)
    {
        switch ($changeType) {
            case User::EVENT_DELETE:
                if ($subject instanceof User) {
Severity: Minor
Found in lib/model/user/UserLibraryImpl.php - About 1 hr 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 buildTaskQueue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function buildTaskQueue(BackendSingletonContainer $container, $scriptArray)
    {
        $chain = new TaskQueueImpl();

        foreach ($scriptArray as $className => $location) {
Severity: Minor
Found in lib/SiteFactoryImpl.php - About 1 hr 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 setPageOrder has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function setPageOrder(Page $page, $place = PageOrder::PAGE_ORDER_LAST, Page $parentPage = null)
    {

        if ($parentPage instanceof Page) {
            if ($this->findPage($parentPage) !== false) {
Severity: Minor
Found in lib/model/page/PageOrderImpl.php - About 1 hr 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 handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handle($type, JSONFunction $function, $instance = null)
    {
        if (isset($this->alias[$type])) {
            foreach ($this->alias[$type] as $target) {
                if (!$this->canHandle($target, $function, $instance)) {
Severity: Minor
Found in lib/controller/ajax/type_handler/GenericObjectTypeHandlerImpl.php - About 1 hr to fix

Method privateRender has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function privateRender(array $context, $initialize = false)
    {
        $userLib = $this->backendContainer->getUserLibraryInstance();
        $currentPageStrat = $this->backendContainer->getCurrentPageStrategyInstance();
        $this->pageElementFactory->clearCache();
Severity: Minor
Found in lib/view/template/TemplateImpl.php - About 1 hr to fix

Method setUp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp(Server $server, $type)
    {

        if (in_array($type, $this->hasBeenSetUp)) {
            return;
Severity: Minor
Found in lib/controller/ajax/type_handler/GenericObjectTypeHandlerImpl.php - About 1 hr to fix

Method getPageElement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPageElement($name, $cached = true)
    {
        if($cached && isset($this->cache[$name])){
            return $this->cache[$name];
        }
Severity: Minor
Found in lib/view/page_element/PageElementFactoryImpl.php - About 1 hr to fix

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

        $id,
        callable $modifyStrategy,
        PDOStatement $addContentStm,
        PDOStatement $latestContentStm,
        PDOStatement $listContentHistStm,
Severity: Major
Found in lib/model/ContentImpl.php - About 1 hr to fix

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/SendMailStrategy.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/RealSendMailStrategyImpl.php - About 50 mins to fix

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

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

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

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

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/PageOrder.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 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
Severity
Category
Status
Source
Language