Showing 1,591 of 20,976 total issues

Function readConfigDir has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function readConfigDir($directory)
    {
        $environment = Ajde_Environment::current();

        $searchDirs = [
Severity: Minor
Found in lib/Ajde/Config/Repository.php - About 25 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 apply has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function apply(array &$tokens)
    {
        $r = 0;
        for ($i = 0, $l = count($tokens); $i < $l; $i++) {
            $current = get_class($tokens[$i]);
Severity: Minor
Found in lib/Ajde/Resource/Local/Compressor/lib/Cssmin.php - About 25 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 _getParamList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _getParamList()
    {
        $params = [];
        if ($this->_code_url_prefix) {
            // Send the URL to each source file instead of the raw source.
Severity: Minor
Found in lib/Ajde/Resource/Local/Compressor/lib/Closure.php - About 25 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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse($index, $char, $previousChar, $state)
    {
        // Start of string
        if ($char === '(' && strtolower(substr($this->parser->getSource(), $index - 3,
                4)) === 'url(' && $state !== 'T_URL'
Severity: Minor
Found in lib/Ajde/Resource/Local/Compressor/lib/Cssmin.php - About 25 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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse($index, $char, $previousChar, $state)
    {
        if ($char === '@' && $state === 'T_DOCUMENT' && strtolower(substr($this->parser->getSource(), $index,
                8)) === '@charset'
        ) {
Severity: Minor
Found in lib/Ajde/Resource/Local/Compressor/lib/Cssmin.php - About 25 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 detect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function detect()
    {
        if (config('i18n.autodetect')) {
            $acceptedLangs = $this->getLanguagesFromHeader();
            foreach ($acceptedLangs as $acceptedLang => $priority) {
Severity: Minor
Found in lib/Ajde/Lang.php - About 25 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 getImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getImage()
    {
        if (isset($this->_cache)) {
            $image = file_get_contents($this->_cache);
        } else {
Severity: Minor
Found in lib/Ajde/Resource/Image.php - About 25 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 resize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function resize($height, $width, $crop = true, $xCorrection = 0, $yCorrection = 0)
    {
        if ($this->imageInCache($width, $height, $crop)) {
            return;
        }
Severity: Minor
Found in lib/Ajde/Resource/Image.php - About 25 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 logonJson has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function logonJson()
    {
        $user = new UserModel();

        $username = Ajde::app()->getRequest()->getPostParam($user->usernameField);
Severity: Minor
Found in core/modules/user/UserController.php - About 25 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 callback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function callback()
    {
        $providerName = $this->getId();
        $provider = Ajde_Shop_Transaction_Provider::getProvider($providerName);
        $status = $provider->updatePayment();
Severity: Minor
Found in core/modules/shop/ShopTransactionController.php - About 25 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 listHtml has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function listHtml()
    {
        if (Ajde::app()->getRequest()->has('edit') || Ajde::app()->getRequest()->has('new')) {
            return $this->editDefault();
        }
Severity: Minor
Found in core/modules/_core/_coreCrudController.php - About 25 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