budde377/Part

View on GitHub

Showing 127 of 140 total issues

Method __construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function __construct(BackendSingletonContainer $container, ImageFile $file)
    {
        $this->container = $container;
        parent::__construct($container, $file);
        $this->whitelistType('ImageFile');
Severity: Minor
Found in lib/controller/ajax/type_handler/ImageFileTypeHandlerImpl.php - About 1 hr to fix

Method __construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function __construct(BackendSingletonContainer $container, Page $page)
    {
        $this->container = $container;
        parent::__construct($page, 'Page');
        $this->whitelistFunction('Page',
Severity: Minor
Found in lib/controller/ajax/type_handler/PageTypeHandlerImpl.php - About 1 hr to fix

Method __construct has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function evaluate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function evaluate(&$message = "", &$status = "")
    {
        if (!isset($_POST['username'], $_POST['password'])) {
            return false;
        }
Severity: Minor
Found in lib/view/page_element/LoginFormulaPageElementImpl.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 canHandle has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function canHandle($type, JSONFunction $function, $instance = null)
    {
        if (isset($this->alias[$type])) {
            $canHandle = false;
            foreach ($this->alias[$type] as $target) {
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

Method __construct has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function __construct(BackendSingletonContainer $container, UserPrivileges $privileges)
    {
        $this->container = $container;
        parent::__construct($privileges);

Severity: Minor
Found in lib/controller/ajax/type_handler/UserPrivilegesTypeHandlerImpl.php - About 1 hr to fix

Method parametersCheck has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function parametersCheck(array $functionArgs, array $parameters)
    {


        $numReqParam = 0;
Severity: Minor
Found in lib/controller/ajax/type_handler/GenericObjectTypeHandlerImpl.php - About 1 hr to fix

Method relativeToAbsolute has 31 lines of code (exceeds 25 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 1 hr to fix

Method generateContent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function generateContent()
    {
        parent::generateContent();
        $latest= null;
        $pageContent = new PageContentImpl($this->container, $this->container->getCurrentPageStrategyInstance()->getCurrentPage(), "mainContent");
Severity: Minor
Found in lib/view/page_element/FrontPageTextPageElementImpl.php - About 1 hr to fix

Method update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function update()
    {
        $this->setUpVersion();
        $connection = $this->getConnection();
        foreach ($this->folders as $name => $path) {
Severity: Minor
Found in lib/util/db/MySQLDBImpl.php - About 1 hr to fix

Method evaluate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function evaluate(&$message = "", &$status = "")
    {
        if (!isset($_POST['username'], $_POST['password'])) {
            return false;
        }
Severity: Minor
Found in lib/view/page_element/LoginFormulaPageElementImpl.php - About 1 hr to fix

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

    function __construct(DB $database,
                         Observable $observable,
                         $param_name,
                         callable $update_param,
                         callable $set_check,
Severity: Major
Found in lib/model/BindParamObserverVariablesImpl.php - About 1 hr to fix

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

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

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