budde377/Part

View on GitHub

Showing 127 of 140 total issues

Function setUpElement has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function setUpElement()
    {
        parent::setUpElement();
        $path = "/";
        if(isset($_SERVER["HTTP_REFERER"]) && ($url = parse_url($_SERVER["HTTP_REFERER"])) &&
Severity: Minor
Found in lib/view/page_element/LogoutPageElementImpl.php - About 2 hrs 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 parseDecoded has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function parseDecoded($obj){

        if(!is_array($obj)){
            return $obj;
        }
Severity: Major
Found in lib/controller/json/ParserImpl.php - About 2 hrs to fix

Function userLogin has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private function userLogin()
    {

        return function (UserLibrary $instance, $username, $password) {
            if (($user = $instance->getUser($username)) == null && $this->validMail($username)) {
Severity: Minor
Found in lib/controller/ajax/type_handler/UserLibraryTypeHandlerImpl.php - About 2 hrs 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 internalHandleProgram has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function internalHandleProgram(Program $input)
    {
        $result = null;
        if ($input instanceof CompositeFunction) {

Severity: Minor
Found in lib/controller/ajax/ServerImpl.php - About 2 hrs 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 __construct has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(BackendSingletonContainer $container, Page $page, $id = "")
    {
        $connection = $container->getDBInstance()->getConnection();
        $this->container = $container;
        $this->page = $page;
Severity: Minor
Found in lib/model/page/PageContentImpl.php - About 1 hr to fix

Function handle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function handle(array $types, JSONFunction $function, $instance = null, $generatedHandler = null)
    {
        foreach ($types as $type) {

            if ($generatedHandler instanceof TypeHandler) {
Severity: Minor
Found in lib/controller/ajax/ServerImpl.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 __get has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function __get($name)
    {
        $name = strtolower($name);
        switch ($name) {
            case 'site':
Severity: Minor
Found in lib/BackendSingletonContainerImpl.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 expectProgram has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function expectProgram()
    {
        $t = $this->expectType();
        $fc = $cf = null;
        if ($this->look_ahead == Lexer::T_L_BRACKET || ($this->look_ahead == Lexer::T_DOT && $this->look_ahead_2 != Lexer::T_DOT && $this->look_ahead_2 != Lexer::T_L_BRACKET)) {
Severity: Minor
Found in lib/controller/function_string/ParserImpl.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 __get has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __get($name)
    {
        $name = strtolower($name);
        switch ($name) {
            case 'site':
Severity: Minor
Found in lib/BackendSingletonContainerImpl.php - About 1 hr to fix

Method setUpElement has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUpElement()
    {
        parent::setUpElement();
        $path = "/";
        if(isset($_SERVER["HTTP_REFERER"]) && ($url = parse_url($_SERVER["HTTP_REFERER"])) &&
Severity: Minor
Found in lib/view/page_element/LogoutPageElementImpl.php - About 1 hr to fix

Function getPageElement has a Cognitive Complexity of 14 (exceeds 5 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

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 detectLoop has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private function detectLoop($childID, $parentID)
    {

        $prevID = $parentID;
        $loopDetected = 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

Function listLog has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function listLog($level = null, $time = 0)
    {
        if(!$this->exists()){
            return array();
        }
Severity: Minor
Found in lib/util/file/LogFileImpl.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 listFolder has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function listFolder($listType = Folder::LIST_FOLDER_ALL)
    {
        $dir = @scandir($this->folderPath);
        if ($dir === false) {
            return false;
Severity: Minor
Found in lib/util/file/FolderImpl.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 fileFromScaleMethod has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function fileFromScaleMethod(ImageFile $file, $scaleArray)
    {

        if (!is_array($scaleArray) || !isset($scaleArray["height"], $scaleArray["width"], $scaleArray["scaleMethod"], $scaleArray["dataURI"])) {
            return null;
Severity: Minor
Found in lib/controller/ajax/type_handler/FileLibraryTypeHandlerImpl.php - About 1 hr to fix

Function setUp has a Cognitive Complexity of 12 (exceeds 5 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

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 handle has a Cognitive Complexity of 12 (exceeds 5 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

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 fileFromScaleMethod has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function fileFromScaleMethod(ImageFile $file, $scaleArray)
    {

        if (!is_array($scaleArray) || !isset($scaleArray["height"], $scaleArray["width"], $scaleArray["scaleMethod"], $scaleArray["dataURI"])) {
            return null;
Severity: Minor
Found in lib/controller/ajax/type_handler/FileLibraryTypeHandlerImpl.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 registerHandlersFromConfig has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function registerHandlersFromConfig()
    {
        $config = $this->container->getConfigInstance();
        foreach ($config->getAJAXTypeHandlers() as $handlerArray) {

Severity: Minor
Found in lib/controller/ajax/ServerImpl.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 __construct has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function __construct(BackendSingletonContainer $container, User $user)
    {
        $this->container = $container;

        parent::__construct($user, 'User');
Severity: Minor
Found in lib/controller/ajax/type_handler/UserTypeHandlerImpl.php - About 1 hr to fix
Severity
Category
Status
Source
Language