YetiForceCompany/YetiForceCRM

View on GitHub
app/Extension/Twig/SecurityPolicy.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Missing class import via use statement (line '39', column '14').
Open

        return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);
Severity: Minor
Found in app/Extension/Twig/SecurityPolicy.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid unused private fields such as '$allowedFunctions'.
Open

    private $allowedFunctions = ['YFParser'];
Severity: Minor
Found in app/Extension/Twig/SecurityPolicy.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid unused private fields such as '$allowedFilters'.
Open

    private $allowedFilters = ['escape', 'lower', 'upper', 'date', 'split'];
Severity: Minor
Found in app/Extension/Twig/SecurityPolicy.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid unused private fields such as '$allowedProperties'.
Open

    private $allowedProperties = [];
Severity: Minor
Found in app/Extension/Twig/SecurityPolicy.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid unused private fields such as '$allowedTags'.
Open

    private $allowedTags = ['if', 'for', 'set'];
Severity: Minor
Found in app/Extension/Twig/SecurityPolicy.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid unused private fields such as '$allowedMethods'.
Open

    private $allowedMethods = [];
Severity: Minor
Found in app/Extension/Twig/SecurityPolicy.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Call to method __construct from undeclared class \Twig\Sandbox\SecurityPolicy
Open

        return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);
Severity: Critical
Found in app/Extension/Twig/SecurityPolicy.php by phan

Return type of getPolicy() is undeclared type \Twig\Sandbox\SecurityPolicy
Open

    public static function getPolicy(): \Twig\Sandbox\SecurityPolicy
Severity: Minor
Found in app/Extension/Twig/SecurityPolicy.php by phan

Spaces must be used to indent lines; tabs are not allowed
Open

    private $allowedMethods = [];

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    private $allowedTags = ['if', 'for', 'set'];

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Allowed properties */

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    private $allowedFilters = ['escape', 'lower', 'upper', 'date', 'split'];

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \Twig\Sandbox\SecurityPolicy

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Allowed methods */

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Allowed functions */

Spaces must be used to indent lines; tabs are not allowed
Open

    private $allowedFunctions = ['YFParser'];

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance = new self();

Line exceeds 120 characters; contains 185 characters
Open

        return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    private $allowedProperties = [];

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getPolicy(): \Twig\Sandbox\SecurityPolicy

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Allowed filters */

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets the sandbox security policy.

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Allowed tags */

Spaces must be used to indent lines; tabs are not allowed
Open

        return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);

There are no issues that match your filters.

Category
Status