XoopsModules25x/mylinks

View on GitHub

Showing 272 of 370 total issues

Function AddFont has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

function AddFont($family,$style='',$file='')
{
  //Add a TrueType or Type1 font
  $family=strtolower($family);
  if($file=='')
Severity: Minor
Found in fpdf/fpdf.php - About 4 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 render has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function render($diff)
    {
        $xi      = $yi = 1;
        $block   = false;
        $context = array();
Severity: Minor
Found in class/Text_Diff_Renderer.php - About 4 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 MultiCell has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)
{
  //Output text with automatic or explicit line breaks
  $cw=&$this->CurrentFont['cw'];
  if($w==0)
Severity: Major
Found in fpdf/fpdf.php - About 4 hrs to fix

    Method _putfonts has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function _putfonts()
    {
      $nf=$this->n;
      foreach($this->diffs as $diff)
      {
    Severity: Major
    Found in fpdf/fpdf.php - About 4 hrs to fix

      Function _putpages has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      function _putpages()
      {
        $nb=$this->page;
        if(!empty($this->AliasNbPages))
        {
      Severity: Minor
      Found in fpdf/fpdf.php - About 4 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 getPng has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

        function getPng($bgColor)
        {
          $out = '';
      
          if(!$this->m_bLoaded) {
      Severity: Minor
      Found in fpdf/gif.php - About 4 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 b_system_waiting_show has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      function b_system_waiting_show()
      {
          global $xoopsUser;
          $xoopsDB        = XoopsDatabaseFactory::getDatabaseConnection();
          $moduleHandler = xoops_getHandler('module');
      Severity: Minor
      Found in extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php - About 4 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 SJISMultiCell has 98 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function SJISMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
      {
        //Output text with automatic or explicit line breaks
        $cw=&$this->CurrentFont['cw'];
        if($w==0)
      Severity: Major
      Found in fpdf/japanese.php - About 3 hrs to fix

        Function _putimages has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

        function _putimages()
        {
          $filter= $this->compress ? '/Filter /FlateDecode ' : '';
          reset($this->images);
          while(list($file,$info)=each($this->images))
        Severity: Minor
        Found in fpdf/fpdf.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

        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

        Method ReadAFM has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ReadAFM($file,&$map)
        {
          //Read a font metric file
          $a=file($file);
          if(empty($a))
        Severity: Major
        Found in fpdf/font/makefont/makefont.php - About 3 hrs to fix

          Method SJISWrite has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function SJISWrite($h,$txt,$link)
          {
            //SJIS version of Write()
            $cw=&$this->CurrentFont['cw'];
            $w=$this->w-$this->rMargin-$this->x;
          Severity: Major
          Found in fpdf/japanese.php - About 3 hrs to fix

            Function importCats has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            function importCats()
            {
                global $xoopsDB, $xoopsModule, $xoopsConfig, $myts;
            
                $ok = MylinksUtility::mylinks_cleanVars($_POST, 'ok', 0, 'int', array('min' => 0, 'max' => 1));
            Severity: Minor
            Found in admin/main.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

            Function xoops_module_update_mylinks_base has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            function xoops_module_update_mylinks_base(XoopsModule $xoopsModule, $prev_version)
            {
                $minUpgradeFrom = '0.0.0';  //minimum version of module supported for upgrade
                $success        = false;
            
            
            Severity: Minor
            Found in include/onupdate.inc.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

            Method FPDF has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function FPDF($orientation='P',$unit='mm',$format='A4')
            {
              //Some checks
              $this->_dochecks();
              //Initialization of properties
            Severity: Major
            Found in fpdf/fpdf.php - About 3 hrs to fix

              Method LZWCommand has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function LZWCommand(&$data, $bInit)
                {
                  if($bInit) {
                    $this->SetCodeSize = ord($data{0});
                    $data = substr($data, 1);
              Severity: Major
              Found in fpdf/gif.php - About 3 hrs to fix

                Method MBMultiCell has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
                {
                  //Multi-byte version of MultiCell()
                  $cw=&$this->CurrentFont['cw'];
                  if($w==0)
                Severity: Major
                Found in fpdf/korean.php - About 3 hrs to fix

                  Method MBMultiCell has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
                  {
                    //Multi-byte version of MultiCell()
                    $cw=&$this->CurrentFont['cw'];
                    if($w==0)
                  Severity: Major
                  Found in fpdf/chinese.php - About 3 hrs to fix

                    Method _putfonts has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function _putfonts()
                    {
                      $nf=$this->n;
                      foreach($this->diffs as $diff)
                      {
                    Severity: Major
                    Found in fpdf/japanese.php - About 3 hrs to fix

                      Method _putfonts has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function _putfonts()
                      {
                        $nf=$this->n;
                        foreach($this->diffs as $diff)
                        {
                      Severity: Major
                      Found in fpdf/korean.php - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language