XoopsModules25x/mylinks

View on GitHub

Showing 370 of 370 total issues

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

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

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            if($this->m_img->m_gih->m_bLocalClr) {
              $nColors = $this->m_img->m_gih->m_nTableSize;
              $rgbq    = $this->m_img->m_gih->m_colorTable->toRGBQuad();
              if($bgColor != -1) {
                $bgColor = $this->m_img->m_gih->m_colorTable->colorIndex($bgColor);
        Severity: Major
        Found in fpdf/gif.php and 1 other location - About 3 hrs to fix
        fpdf/gif.php on lines 954..971

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 154.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            if($this->m_img->m_gih->m_bLocalClr) {
              $nColors = $this->m_img->m_gih->m_nTableSize;
              $pal     = $this->m_img->m_gih->m_colorTable->toString();
              if($bgColor != -1) {
                $bgColor = $this->m_img->m_gih->m_colorTable->colorIndex($bgColor);
        Severity: Major
        Found in fpdf/gif.php and 1 other location - About 3 hrs to fix
        fpdf/gif.php on lines 849..866

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 154.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

        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

        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 _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

              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 _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

                  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/chinese.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
                        Severity
                        Category
                        Status
                        Source
                        Language