XoopsModules25x/mylinks

View on GitHub
fpdf/makepdf_class.php

Summary

Maintainability
D
2 days
Test Coverage

Function WriteHTML has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

  function WriteHTML($html,$scale)
  {
  //    $html=strip_tags($html,"<b><u><i><a><img><p><br><strong><em><font><tr><blockquote>"); //remove all unsupported tags
      $html=str_replace("\n",' ',$html); //replace carriage returns by spaces
      $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE); //explodes the string
Severity: Minor
Found in fpdf/makepdf_class.php - About 3 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

File makepdf_class.php has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// $Id: makepdf_class.php 8112 2011-11-06 13:41:14Z beckmi $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
Severity: Minor
Found in fpdf/makepdf_class.php - About 3 hrs to fix

    Method OpenTag has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function OpenTag($tag,$attr,$scale)
      {
          //Opening tag
          switch($tag){
              case 'STRONG':
    Severity: Major
    Found in fpdf/makepdf_class.php - About 2 hrs to fix

      Method PutImage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function PutImage($url,$scale)
        {
          if($scale<0) $scale=0;
          //$scale<=0: put NO image inside the pdf!
          if($scale>0){
      Severity: Minor
      Found in fpdf/makepdf_class.php - About 1 hr to fix

        Method _parsegif has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function _parsegif($file)
          {
            require_once 'gif.php'; //GIF class in pure PHP from Yamasoft (http://www.yamasoft.com/php-gif.zip)
        
            $h=0;
        Severity: Minor
        Found in fpdf/makepdf_class.php - About 1 hr to fix

          Function OpenTag has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            function OpenTag($tag,$attr,$scale)
            {
                //Opening tag
                switch($tag){
                    case 'STRONG':
          Severity: Minor
          Found in fpdf/makepdf_class.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

          Function _parsegif has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            function _parsegif($file)
            {
              require_once 'gif.php'; //GIF class in pure PHP from Yamasoft (http://www.yamasoft.com/php-gif.zip)
          
              $h=0;
          Severity: Minor
          Found in fpdf/makepdf_class.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 WriteHTML has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function WriteHTML($html,$scale)
            {
            //    $html=strip_tags($html,"<b><u><i><a><img><p><br><strong><em><font><tr><blockquote>"); //remove all unsupported tags
                $html=str_replace("\n",' ',$html); //replace carriage returns by spaces
                $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE); //explodes the string
          Severity: Minor
          Found in fpdf/makepdf_class.php - About 1 hr to fix

            Function PutImage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

              function PutImage($url,$scale)
              {
                if($scale<0) $scale=0;
                //$scale<=0: put NO image inside the pdf!
                if($scale>0){
            Severity: Minor
            Found in fpdf/makepdf_class.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

            Function CloseTag has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              function CloseTag($tag)
              {
                  //Closing tag
                  if($tag=='STRONG')
                      $tag='B';
            Severity: Minor
            Found in fpdf/makepdf_class.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

            There are no issues that match your filters.

            Category
            Status