XoopsModules25x/mylinks

View on GitHub

Showing 272 of 370 total issues

Function SetFillColor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function SetFillColor($r,$g=-1,$b=-1)
{
  //Set color for all filling operations
  if(($r==0 && $g==0 && $b==0) || $g==-1)
    $this->FillColor=sprintf('%.3f g',$r/255);
Severity: Minor
Found in fpdf/fpdf.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 encoding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  function encoding(&$text, $in_charset)
  {
    $out_charset = $GLOBALS['valid_pfd_charset'];
      if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return;

Severity: Minor
Found in fpdf/language/french.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 encoding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  function encoding(&$text, $in_charset)
  {
    $out_charset = $GLOBALS['valid_pfd_charset'];
      if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return;

Severity: Minor
Found in fpdf/language/tchinese.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 encoding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  function encoding(&$text, $in_charset)
  {
    $out_charset = $GLOBALS['valid_pfd_charset'];
      if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return;

Severity: Minor
Found in fpdf/language/japanese.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 listNewLinks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function listNewLinks()
{
    global $xoopsDB, $myts, $myCatTree, $xoopsModule;
    // List links waiting for validation
    $linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/images/shots/');
Severity: Minor
Found in admin/main.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 copy_templates_f2db has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function copy_templates_f2db($tplset_to, $whr_append = '1')
{
    global $db;

    // get tplsource
Severity: Minor
Found in admin/mytplsadmin.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 _renderOptionTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
    {
        $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" onclick=\"";
        // If there are parent elements, add javascript that will
        // make them selecteded when this element is checked to make
Severity: Minor
Found in admin/mygrouppermform.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 getTotalItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getTotalItems($sel_id = null, $status = '', $oper = '>')
{
    $sel_id = filter_var($sel_id, FILTER_VALIDATE_INT, array('options' => array('default' => 0, 'min_range' => 0)));
    $count  = 0;
    $arr    = array();
Severity: Minor
Found in include/functions.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 b_mylinks_top_show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function b_mylinks_top_show($options)
{
    global $xoopsDB;
    $block = array();
    //ver2.5
Severity: Minor
Found in blocks/mylinks_top.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 _check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check($from_lines, $to_lines)
    {
        if (serialize($from_lines) != serialize($this->getOriginal())) {
            trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
        }
Severity: Minor
Found in class/Text_Diff.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

Avoid too many return statements within this method.
Open

    return $Code;
Severity: Major
Found in fpdf/gif.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

        return false;
    Severity: Major
    Found in fpdf/gif.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return -2;
      Severity: Major
      Found in fpdf/gif.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                  return -1;
        Severity: Major
        Found in fpdf/gif.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return false;
          Severity: Major
          Found in fpdf/gif.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $this->Stack[$this->sp];
            Severity: Major
            Found in fpdf/gif.php - About 30 mins to fix

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

                function _encoding(&$text, $in_charset, $out_charset)
                {
                  $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
                  if($xconv_handler &&
                    $converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
              Severity: Minor
              Found in fpdf/language/tchinese.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 _encoding has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                function _encoding(&$text, $in_charset, $out_charset)
                {
                  $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
                  if($xconv_handler &&
                    $converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
              Severity: Minor
              Found in fpdf/language/japanese.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 gif_outputAsJpeg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function gif_outputAsJpeg($gif, $lpszFileName, $bgColor = -1)
              {
                if(gif_outputAsBmp($gif, "$lpszFileName.bmp", $gbColor)) {
                  exec("cjpeg $lpszFileName.bmp >$lpszFileName 2>/dev/null");
                  @unLink("$lpszFileName.bmp");
              Severity: Minor
              Found in fpdf/gif.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