Showing 1,591 of 20,976 total issues

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

    public function create(array $data = [])
    {
        $encoded = json_encode($data);

        if (version_compare(phpversion(), '5.3.0', '>=')) {
Severity: Minor
Found in lib/Ajde/Shop/Transaction/Provider/Mollie/API/Resource/Base.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($str = null, $initialVariables = null)
    {
        if (is_array($str)) {
            $initialVariables = $str;
            $str = null;
Severity: Minor
Found in lib/Ajde/Document/Processor/Css/lib/less/lessc.inc.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 getAvailableTranslations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAvailableTranslations()
    {
        $lang = Ajde_Lang::getInstance();
        $langs = $lang->getAvailableNiceNames();

Severity: Minor
Found in lib/Ajde/Crud/Field/I18n.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 findRule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function findRule($type, $ugId, $module, $action, $extra)
    {
        foreach ($this as $rule) {
            if (
                (
Severity: Minor
Found in lib/Ajde/Acl/Collection.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 getBody has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBody()
    {
        $body = json_encode($this->get('body'));
        if (config('app.debug')) {
            if (Ajde_Dump::getAll()) {
Severity: Minor
Found in lib/Ajde/Document/Format/Json.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 getRedirectUrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRedirectUrl($description = null)
    {
        $transaction = $this->getTransaction();

        $request = [
Severity: Minor
Found in lib/Ajde/Shop/Transaction/Provider/Wedeal.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 getSortField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSortField()
    {
        if ($this->hasTableFields()) {
            foreach ($this->getTableFields() as $extraField) {
                if ($extraField['type'] == 'sort') {
Severity: Minor
Found in lib/Ajde/Crud/Field/Multiple.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 compileBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function compileBlock($block)
    {
        switch ($block->type) {
            case 'root':
                $this->compileRoot($block);
Severity: Minor
Found in lib/Ajde/Document/Processor/Css/lib/less/lessc.inc.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 publish has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function publish()
    {
        $tweet = $this->getTitle();
        if ($url = $this->getUrl()) {
            $tweet = substr($tweet, 0, 140 - strlen($url) - 5).'... '.$url;
Severity: Minor
Found in lib/Ajde/Publisher/Twitter/Twitter.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 loadCurrent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadCurrent()
    {
        $loaded = false;

        if ($user = UserModel::getLoggedIn()) {
Severity: Minor
Found in lib/Ajde/Shop/Cart.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 isEmpty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function isEmpty($block)
    {
        if (empty($block->lines)) {
            foreach ($block->children as $child) {
                if (!$this->isEmpty($child)) {
Severity: Minor
Found in lib/Ajde/Document/Processor/Css/lib/less/lessc.inc.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 lengthIndicator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function lengthIndicator($mode, $version)
    {
        if ($mode == QR_MODE_STRUCTURE) {
            return 0;
        }
Severity: Minor
Found in lib/Ajde/Resource/Qrcode/lib/phpqrcode.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 debug has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function debug($frame, $binary_mode = false)
    {
        if ($binary_mode) {
            foreach ($frame as &$frameLine) {
                $frameLine = implode('<span class="m">&nbsp;&nbsp;</span>', explode('0', $frameLine));
Severity: Minor
Found in lib/Ajde/Resource/Qrcode/lib/phpqrcode.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 variable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function variable(&$name)
    {
        $s = $this->seek();
        if ($this->literal($this->lessc->vPrefix, false) &&
            ($this->variable($sub) || $this->keyword($name))
Severity: Minor
Found in lib/Ajde/Document/Processor/Css/lib/less/lessc.inc.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 mask has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function mask($width, $frame, $level)
    {
        $minDemerit = PHP_INT_MAX;
        $bestMaskNum = 0;
        $bestMask = [];
Severity: Minor
Found in lib/Ajde/Resource/Qrcode/lib/phpqrcode.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 factory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4)
    {
        $enc = new self();
        $enc->size = $size;
        $enc->margin = $margin;
Severity: Minor
Found in lib/Ajde/Resource/Qrcode/lib/phpqrcode.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 estimateBitStreamSizeOfEntry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function estimateBitStreamSizeOfEntry($version)
    {
        $bits = 0;

        if ($version == 0) {
Severity: Minor
Found in lib/Ajde/Resource/Qrcode/lib/phpqrcode.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 guards has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function guards(&$guards)
    {
        $s = $this->seek();

        if (!$this->literal('when')) {
Severity: Minor
Found in lib/Ajde/Document/Processor/Css/lib/less/lessc.inc.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 image has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4)
    {
        $h = count($frame);
        $w = strlen($frame[0]);

Severity: Minor
Found in lib/Ajde/Resource/Qrcode/lib/phpqrcode.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 calcParity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function calcParity()
    {
        $parity = 0;

        foreach ($this->items as $item) {
Severity: Minor
Found in lib/Ajde/Resource/Qrcode/lib/phpqrcode.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