XoopsModules25x/latestnews

View on GitHub
include/gtickets.php

Summary

Maintainability
D
2 days
Test Coverage

Function check has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    function check( $post = true , $area = '' , $allow_repost = true )
    {
        global $xoopsModule ;

        $this->_errors = array() ;
Severity: Minor
Found in include/gtickets.php - About 7 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 draw_repost_form has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    function draw_repost_form( $area = '' )
    {
        // Notify which file is broken
        if ( headers_sent() ) {
            restore_error_handler() ;
Severity: Minor
Found in include/gtickets.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 check has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function check( $post = true , $area = '' , $allow_repost = true )
    {
        global $xoopsModule ;

        $this->_errors = array() ;
Severity: Minor
Found in include/gtickets.php - About 1 hr to fix

    Function extract_post_recursive has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        function extract_post_recursive( $key_name , $tmp_array )
        {
            $table = '' ;
            $form = '' ;
            foreach ($tmp_array as $key => $val) {
    Severity: Minor
    Found in include/gtickets.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 draw_repost_form has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function draw_repost_form( $area = '' )
        {
            // Notify which file is broken
            if ( headers_sent() ) {
                restore_error_handler() ;
    Severity: Minor
    Found in include/gtickets.php - About 1 hr to fix

      Function XoopsGTicket has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          function XoopsGTicket()
          {
              global $xoopsConfig ;
      
              // language file
      Severity: Minor
      Found in include/gtickets.php - About 45 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 issue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          function issue( $salt = '' , $timeout = 1800 , $area = '' )
          {
              global $xoopsModule ;
      
              // create a token
      Severity: Minor
      Found in include/gtickets.php - About 35 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 admin_refcheck has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function admin_refcheck($chkref = "")
      {
          if ( empty( $_SERVER['HTTP_REFERER'] ) ) {
              return true ;
          } else {
      Severity: Minor
      Found in include/gtickets.php - About 35 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 getErrors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          function getErrors( $ashtml = true )
          {
              if ($ashtml) {
                  $ret = '' ;
                  foreach ($this->_errors as $msg) {
      Severity: Minor
      Found in include/gtickets.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

      There are no issues that match your filters.

      Category
      Status