XoopsModules25x/mylinks

View on GitHub

Showing 370 of 370 total issues

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

function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
{
  //Output a cell
  $k=$this->k;
  if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak())
Severity: Major
Found in fpdf/fpdf.php - About 2 hrs to fix

    Method _parsepng has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function _parsepng($file)
    {
      //Extract info from a PNG file
      $f=fopen($file,'rb');
      if(!$f)
    Severity: Major
    Found in fpdf/fpdf.php - About 2 hrs to fix

      Method MBWrite has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method MBWrite has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method Write has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Write($h,$txt,$link='')
          {
            //Output text in flowing mode
            $cw=&$this->CurrentFont['cw'];
            $w=$this->w-$this->rMargin-$this->x;
          Severity: Major
          Found in fpdf/fpdf.php - About 2 hrs to fix

            File mytplsadmin.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            // ------------------------------------------------------------------------- //
            //                              mytplsadmin.php                              //
            //               - XOOPS templates admin for each modules -                  //
            //                          GIJOE <http://www.peak.ne.jp/>                   //
            Severity: Minor
            Found in admin/mytplsadmin.php - About 2 hrs to fix

              Method myblocksadmin_update_block has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function myblocksadmin_update_block(
                  $bid,
                  $bside,
                  $bweight,
                  $bvisible,
              Severity: Major
              Found in include/blocksadmin.inc.php - About 2 hrs to fix

                Method _shiftBoundaries has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _shiftBoundaries($lines, &$changed, $other_changed)
                    {
                        $i = 0;
                        $j = 0;
                
                
                Severity: Major
                Found in class/Text_Diff.php - About 2 hrs to fix

                  Method _diag has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _diag($xoff, $xlim, $yoff, $ylim, $nchunks)
                      {
                          $flip = false;
                  
                          if ($xlim - $xoff > $ylim - $yoff) {
                  Severity: Major
                  Found in class/Text_Diff.php - About 2 hrs to fix

                    Identical blocks of code found in 3 locations. Consider refactoring.
                    Open

                    function AddCIDFonts($family,$name,$cw,$CMap,$registry)
                    {
                      $this->AddCIDFont($family,'',$name,$cw,$CMap,$registry);
                      $this->AddCIDFont($family,'B',$name.',Bold',$cw,$CMap,$registry);
                      $this->AddCIDFont($family,'I',$name.',Italic',$cw,$CMap,$registry);
                    Severity: Major
                    Found in fpdf/korean.php and 2 other locations - About 2 hrs to fix
                    fpdf/chinese.php on lines 42..48
                    fpdf/japanese.php on lines 30..36

                    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 132.

                    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

                    Identical blocks of code found in 3 locations. Consider refactoring.
                    Open

                    function AddCIDFonts($family,$name,$cw,$CMap,$registry)
                    {
                      $this->AddCIDFont($family,'',$name,$cw,$CMap,$registry);
                      $this->AddCIDFont($family,'B',$name.',Bold',$cw,$CMap,$registry);
                      $this->AddCIDFont($family,'I',$name.',Italic',$cw,$CMap,$registry);
                    Severity: Major
                    Found in fpdf/japanese.php and 2 other locations - About 2 hrs to fix
                    fpdf/chinese.php on lines 42..48
                    fpdf/korean.php on lines 31..37

                    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 132.

                    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

                    Identical blocks of code found in 3 locations. Consider refactoring.
                    Open

                    function AddCIDFonts($family,$name,$cw,$CMap,$registry)
                    {
                      $this->AddCIDFont($family,'',$name,$cw,$CMap,$registry);
                      $this->AddCIDFont($family,'B',$name.',Bold',$cw,$CMap,$registry);
                      $this->AddCIDFont($family,'I',$name.',Italic',$cw,$CMap,$registry);
                    Severity: Major
                    Found in fpdf/chinese.php and 2 other locations - About 2 hrs to fix
                    fpdf/japanese.php on lines 30..36
                    fpdf/korean.php on lines 31..37

                    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 132.

                    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

                    Method _putpages has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function _putpages()
                    {
                      $nb=$this->page;
                      if(!empty($this->AliasNbPages))
                      {
                    Severity: Major
                    Found in fpdf/fpdf.php - About 2 hrs to fix

                      Method addLink has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function addLink()
                      {
                          global $xoopsDB, $myts, $xoopsUser, $xoopsModule;
                      
                          $cid         = MylinksUtility::mylinks_cleanVars($_POST, 'cid', 0, 'int', array('min' => 0));
                      Severity: Major
                      Found in admin/main.php - About 2 hrs to fix

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

                        function GetMBStringWidth($s)
                        {
                          //Multi-byte version of GetStringWidth()
                          $l=0;
                          $cw=&$this->CurrentFont['cw'];
                        Severity: Major
                        Found in fpdf/korean.php and 1 other location - About 2 hrs to fix
                        fpdf/chinese.php on lines 96..119

                        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 130.

                        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

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

                        function GetMBStringWidth($s)
                        {
                          //Multi-byte version of GetStringWidth()
                          $l=0;
                          $cw=&$this->CurrentFont['cw'];
                        Severity: Major
                        Found in fpdf/chinese.php and 1 other location - About 2 hrs to fix
                        fpdf/korean.php on lines 66..89

                        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 130.

                        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 AddPage has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function AddPage($orientation='')
                        {
                          //Start a new page
                          if($this->state==0)
                            $this->Open();
                        Severity: Minor
                        Found in fpdf/fpdf.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

                        Function b_system_main_show has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function b_system_main_show()
                        {
                            global $xoopsUser, $xoopsModule;
                            $block               = array();
                            $block['lang_home']  = _MB_SYSTEM_HOME;
                        Severity: Minor
                        Found in extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.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

                        File viewcat.php has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        // $Id: viewcat.php 11819 2013-07-09 18:21:40Z zyspec $
                        //  ------------------------------------------------------------------------ //
                        //                XOOPS - PHP Content Management System                      //
                        //                    Copyright (c) 2000 XOOPS.org                           //
                        Severity: Minor
                        Found in viewcat.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language