XoopsModules25x/mylinks

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

        public 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

        public function draw_repost_form($area = '')
        {
            // Notify which file is broken
            if (headers_sent()) {
                restore_errorHandler();
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 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

            $this->_errors = array();
Severity: Major
Found in include/gtickets.php - About 2 hrs to fix

    File gtickets.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    // GIJOE's Ticket Class (based on Marijuana's Oreteki XOOPS)
    // nobunobu's suggestions are applied
    
    if (!class_exists('XoopsGTicket')) {
    Severity: Minor
    Found in include/gtickets.php - About 2 hrs to fix

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

              public 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 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function issue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

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

                public function __construct()
                {
                    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 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

                public 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