MPOS/php-mpos

View on GitHub

Showing 1,089 of 1,089 total issues

Function yylex4 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex4()
    {
        $tokenMap = array (
              1 => 1,
              3 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.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 yylex3 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex3()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.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 yylex6 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex6()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.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 yylex5 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex5()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.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 yylex4 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex4()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.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 yylex2 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex2()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.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 yylex1 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex1()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.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 yylex6 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex6()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.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 yylex3 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function yylex3()
    {
        $tokenMap = array (
              1 => 0,
            );
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.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 sendNotification has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  public function sendNotification($account_id, $strType, $aMailData) {
    // Check if we notified for this event already
    if ( $this->isNotified($aMailData) ) {
      $this->setErrorMessage('A notification for this event has been sent already');
      return false;
Severity: Minor
Found in include/classes/notification.class.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 _doTable_callback has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _doTable_callback($matches) {
        $head        = $matches[1];
        $underline    = $matches[2];
        $content    = $matches[3];

Severity: Minor
Found in include/lib/Michelf/Markdown.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 yy_get_expected_tokens has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function yy_get_expected_tokens($token)
    {
        $state = $this->yystack[$this->yyidx]->stateno;
        $expected = self::$yyExpectedTokens[$state];
        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
Severity: Major
Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 2 hrs to fix

    Method yy_get_expected_tokens has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function yy_get_expected_tokens($token)
        {
            $state = $this->yystack[$this->yyidx]->stateno;
            $expected = self::$yyExpectedTokens[$state];
            if (in_array($token, self::$yyExpectedTokens[$state], true)) {
    Severity: Major
    Found in include/smarty/libs/sysplugins/smarty_internal_templateparser.php - About 2 hrs to fix

      Method getAttributes has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getAttributes($compiler, $attributes)
          {
              $_indexed_attr = array();
              // loop over attributes
              foreach ($attributes as $key => $mixed) {
      Severity: Major
      Found in include/smarty/libs/sysplugins/smarty_internal_compilebase.php - About 2 hrs to fix

        Method yylex4 has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function yylex4()
            {
                $tokenMap = array (
                      1 => 1,
                      3 => 0,
        Severity: Major
        Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.php - About 2 hrs to fix

          Method doLists has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function doLists($text) {
              #
              # Form HTML ordered (numbered) and unordered (bulleted) lists.
              #
                  $less_than_tab = $this->tab_width - 1;
          Severity: Major
          Found in include/lib/Michelf/Markdown.php - About 2 hrs to fix

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                public function yy_pop_parser_stack()
                {
                    if (!count($this->yystack)) {
                        return;
                    }
            include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 1466..1482

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 125.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                public function yy_pop_parser_stack()
                {
                    if (!count($this->yystack)) {
                        return;
                    }
            include/smarty/libs/sysplugins/smarty_internal_configfileparser.php on lines 360..376

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 125.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Smarty_CacheResource_KeyValueStore has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
            {
                /**
                 * cache for contents
                 * @var array
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php - About 2 hrs to fix

              Swift_DependencyContainer has 21 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Swift_DependencyContainer
              {
                  /** Constant for literal value types */
                  const TYPE_VALUE = 0x0001;
              
              
              Severity: Minor
              Found in include/lib/swiftmailer/classes/Swift/DependencyContainer.php - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language