XoopsModules25x/mylinks

View on GitHub

Showing 370 of 370 total issues

File fpdf.php has 1411 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*******************************************************************************
* Software: FPDF                                                               *
* Version:  1.53                                                               *
* Date:     2004-12-31                                                         *
Severity: Major
Found in fpdf/fpdf.php - About 3 days to fix

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

    $SJIS_widths=array(' '=>278,'!'=>299,'"'=>353,'#'=>614,'$'=>614,'%'=>721,'&'=>735,'\''=>216,
      '('=>323,')'=>323,'*'=>449,'+'=>529,','=>219,'-'=>306,'.'=>219,'/'=>453,'0'=>614,'1'=>614,
      '2'=>614,'3'=>614,'4'=>614,'5'=>614,'6'=>614,'7'=>614,'8'=>614,'9'=>614,':'=>219,';'=>219,
      '<'=>529,'='=>529,'>'=>529,'?'=>486,'@'=>744,'A'=>646,'B'=>604,'C'=>617,'D'=>681,'E'=>567,
      'F'=>537,'G'=>647,'H'=>738,'I'=>320,'J'=>433,'K'=>637,'L'=>566,'M'=>904,'N'=>710,'O'=>716,
    Severity: Major
    Found in fpdf/japanese.php and 3 other locations - About 2 days to fix
    fpdf/chinese.php on lines 8..17
    fpdf/chinese.php on lines 19..28
    fpdf/korean.php on lines 8..17

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

    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 4 locations. Consider refactoring.
    Open

    $Big5_widths=array(' '=>250,'!'=>250,'"'=>408,'#'=>668,'$'=>490,'%'=>875,'&'=>698,'\''=>250,
      '('=>240,')'=>240,'*'=>417,'+'=>667,','=>250,'-'=>313,'.'=>250,'/'=>520,'0'=>500,'1'=>500,
      '2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>250,';'=>250,
      '<'=>667,'='=>667,'>'=>667,'?'=>396,'@'=>921,'A'=>677,'B'=>615,'C'=>719,'D'=>760,'E'=>625,
      'F'=>552,'G'=>771,'H'=>802,'I'=>354,'J'=>354,'K'=>781,'L'=>604,'M'=>927,'N'=>750,'O'=>823,
    Severity: Major
    Found in fpdf/chinese.php and 3 other locations - About 2 days to fix
    fpdf/chinese.php on lines 19..28
    fpdf/japanese.php on lines 8..17
    fpdf/korean.php on lines 8..17

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

    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 4 locations. Consider refactoring.
    Open

    $GB_widths=array(' '=>207,'!'=>270,'"'=>342,'#'=>467,'$'=>462,'%'=>797,'&'=>710,'\''=>239,
      '('=>374,')'=>374,'*'=>423,'+'=>605,','=>238,'-'=>375,'.'=>238,'/'=>334,'0'=>462,'1'=>462,
      '2'=>462,'3'=>462,'4'=>462,'5'=>462,'6'=>462,'7'=>462,'8'=>462,'9'=>462,':'=>238,';'=>238,
      '<'=>605,'='=>605,'>'=>605,'?'=>344,'@'=>748,'A'=>684,'B'=>560,'C'=>695,'D'=>739,'E'=>563,
      'F'=>511,'G'=>729,'H'=>793,'I'=>318,'J'=>312,'K'=>666,'L'=>526,'M'=>896,'N'=>758,'O'=>772,
    Severity: Major
    Found in fpdf/chinese.php and 3 other locations - About 2 days to fix
    fpdf/chinese.php on lines 8..17
    fpdf/japanese.php on lines 8..17
    fpdf/korean.php on lines 8..17

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

    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 4 locations. Consider refactoring.
    Open

    $UHC_widths=array(' '=>333,'!'=>416,'"'=>416,'#'=>833,'$'=>625,'%'=>916,'&'=>833,'\''=>250,
      '('=>500,')'=>500,'*'=>500,'+'=>833,','=>291,'-'=>833,'.'=>291,'/'=>375,'0'=>625,'1'=>625,
      '2'=>625,'3'=>625,'4'=>625,'5'=>625,'6'=>625,'7'=>625,'8'=>625,'9'=>625,':'=>333,';'=>333,
      '<'=>833,'='=>833,'>'=>916,'?'=>500,'@'=>1000,'A'=>791,'B'=>708,'C'=>708,'D'=>750,'E'=>708,
      'F'=>666,'G'=>750,'H'=>791,'I'=>375,'J'=>500,'K'=>791,'L'=>666,'M'=>916,'N'=>791,'O'=>750,
    Severity: Major
    Found in fpdf/korean.php and 3 other locations - About 2 days to fix
    fpdf/chinese.php on lines 8..17
    fpdf/chinese.php on lines 19..28
    fpdf/japanese.php on lines 8..17

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

    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

            if (!empty($logourl)) {
                if (file_exists(XOOPSMYLINKIMGPATH . "/{$mylinks_theme}")) {
                    $shotImgSrc = XOOPSMYLINKIMGURL . "/{$mylinks_theme}/shots/" . $myts->htmlSpecialChars($logourl);
                } else {
                    $shotImgSrc = XOOPSMYLINKIMGURL . '/shots/' . $myts->htmlSpecialChars($logourl);
    Severity: Major
    Found in index.php and 1 other location - About 2 days to fix
    singlelink.php on lines 99..121

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

    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

        if (!empty($logourl)) {
            if (file_exists(XOOPSMYLINKIMGPATH . "/{$mylinks_theme}")) {
                $shotImgSrc = XOOPSMYLINKIMGURL . "/{$mylinks_theme}/shots/" . $myts->htmlSpecialChars($logourl);
            } else {
                $shotImgSrc = XOOPSMYLINKIMGURL . '/shots/' . $myts->htmlSpecialChars($logourl);
    Severity: Major
    Found in singlelink.php and 1 other location - About 2 days to fix
    index.php on lines 158..180

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

    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

    File main.php has 829 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * MyLinks category.php
     *
     * Xoops mylinks - a multicategory links module
    Severity: Major
    Found in admin/main.php - About 1 day to fix

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

      if ('clone' == $op) {
          xoops_cp_header();
          $myblock = new XoopsBlock($bid);
      
          $db      = XoopsDatabaseFactory::getDatabaseConnection();
      Severity: Major
      Found in include/blocksadmin.inc.php and 1 other location - About 1 day to fix
      include/blocksadmin.inc.php on lines 355..395

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

      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 ('edit' == $op) {
          xoops_cp_header();
          // edit_block($bid); GIJ imported from blocksadmin.php
          $myblock = new XoopsBlock($bid);
      
      
      Severity: Major
      Found in include/blocksadmin.inc.php and 1 other location - About 1 day to fix
      include/blocksadmin.inc.php on lines 397..434

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

      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

      File gif.php has 793 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      ///////////////////////////////////////////////////////////////////////////////////////////////////
      // GIF Util - (C) 2003 Yamasoft (S/C)
      // http://www.yamasoft.com
      // All Rights Reserved
      Severity: Major
      Found in fpdf/gif.php - About 1 day to fix

        Function MultiCell has a Cognitive Complexity of 68 (exceeds 5 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: Minor
        Found in fpdf/fpdf.php - About 1 day 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

        FPDF has 71 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class FPDF
        {
        //Private properties
        var $page;               //current page number
        var $n;                  //current object number
        Severity: Major
        Found in fpdf/fpdf.php - About 1 day to fix

          Function _putfonts has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
          Open

          function _putfonts()
          {
            $nf=$this->n;
            foreach($this->diffs as $diff)
            {
          Severity: Minor
          Found in fpdf/fpdf.php - About 1 day 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 Cell has a Cognitive Complexity of 59 (exceeds 5 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: Minor
          Found in fpdf/fpdf.php - About 1 day 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 system_blocks.php has 540 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          // $Id: system_blocks.php 8066 2011-11-06 05:09:33Z beckmi $
          //  ------------------------------------------------------------------------ //
          //                XOOPS - PHP Content Management System                      //
          //                    Copyright (c) 2000 XOOPS.org                           //
          Severity: Major
          Found in extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php - About 1 day to fix

            Function ReadAFM has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
            Open

            function ReadAFM($file,&$map)
            {
              //Read a font metric file
              $a=file($file);
              if(empty($a))
            Severity: Minor
            Found in fpdf/font/makefont/makefont.php - About 1 day 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 addto has 212 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function addto(addsite,AddURL,AddTitle){
              var AddURL = AddURL;
              var AddTitle = AddTitle;
              switch(addsite){
                case 0:    //    AddToBookmarks.com ID:0    - an educational page on what Social Bookmarking is
            Severity: Major
            Found in include/addto-multi.js - About 1 day to fix

              File Text_Diff.php has 486 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * Text_Diff
               *
              Severity: Minor
              Found in class/Text_Diff.php - About 7 hrs to fix

                File xoops_version.php has 476 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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