XoopsModules25x/mylinks

View on GitHub

Showing 370 of 370 total issues

Method _enddoc has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function _enddoc()
{
  $this->_putheader();
  $this->_putpages();
  $this->_putresources();
Severity: Minor
Found in fpdf/fpdf.php - About 1 hr to fix

    Method mylinks_get_new has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function mylinks_get_new($param)
    {
        $modulename = basename(dirname(__DIR__));
        include_once XOOPS_ROOT_PATH . "/modules/{$modulename}/include/feeddata.inc.php";
    
    
    Severity: Minor
    Found in include/feedfunc.new.php - About 1 hr to fix

      Method addCat has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function addCat()
      {
          global $xoopsDB, $myts, $xoopsModule;
          $pid    = MylinksUtility::mylinks_cleanVars($_POST, 'pid', 0, 'int', array('min' => 0));
          $title  = MylinksUtility::mylinks_cleanVars($_POST, 'title', '', 'string');
      Severity: Minor
      Found in admin/main.php - About 1 hr to fix

        Method load has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function load($lpData, &$hdrLen)
          {
            $hdrLen = 0;
        
            $this->m_lpVer = substr($lpData, 0, 6);
        Severity: Minor
        Found in fpdf/gif.php - About 1 hr to fix

          Method b_system_topposters_edit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function b_system_topposters_edit($options)
          {
              include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
              $inputtag = "<input type='text' name='options[]' value='" . (int)$options[0] . "'>";
              $form     = sprintf(_MB_SYSTEM_DISPLAY, $inputtag);
          Severity: Minor
          Found in extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

            Method mylinks_cleanVars has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function mylinks_cleanVars(&$global, $key, $default = '', $type = 'int', $limit = null)
                {
                    switch ($type) {
                        case 'string':
                            $ret = isset($global[$key]) ? filter_var($global[$key], FILTER_SANITIZE_MAGIC_QUOTES) : $default;
            Severity: Minor
            Found in class/utility.php - About 1 hr to fix

              Method modCat has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function modCat()
              {
                  global $xoopsDB, $myts, $xoopsModule;
              
                  $cid = MylinksUtility::mylinks_cleanVars($_GET, 'cid', 0, 'int', array('min' => 0));
              Severity: Minor
              Found in admin/main.php - About 1 hr to fix

                Method modCatS has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function modCatS()
                {
                    global $xoopsDB, $myts, $xoopsModule;
                    $cid    = MylinksUtility::mylinks_cleanVars($_POST, 'cid', 0, 'int', array('min' => 0));
                    $imgurl = MylinksUtility::mylinks_cleanVars($_POST, 'imgurl', '', 'string');
                Severity: Minor
                Found in admin/main.php - About 1 hr to fix

                  Method mylinks_search has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function mylinks_search($queryarray, $andor, $limit, $offset, $userid)
                  {
                      global $xoopsDB;
                      $sql = 'SELECT l.lid,l.cid,l.title,l.submitter,l.date,t.description FROM ' . $xoopsDB->prefix('mylinks_links') . ' l LEFT JOIN ' . $xoopsDB->prefix('mylinks_text') . ' t ON t.lid=l.lid WHERE status>0';
                      if ($userid != 0) {
                  Severity: Minor
                  Found in include/search.inc.php - About 1 hr to fix

                    Method b_mylinks_random_show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function b_mylinks_random_show()
                    {
                        global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsUser;
                        $moduleDirName = basename(dirname(__DIR__));
                        $myts       = MyTextSanitizer::getInstance();
                    Severity: Minor
                    Found in blocks/mylinks_rand.php - About 1 hr to fix

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

                      function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
                      {
                        if($this->CurrentFont['type']=='Type0')
                          $this->MBMultiCell($w,$h,$txt,$border,$align,$fill);
                        else
                      Severity: Major
                      Found in fpdf/chinese.php and 2 other locations - About 1 hr to fix
                      fpdf/japanese.php on lines 100..106
                      fpdf/korean.php on lines 91..97

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

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

                      function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
                      {
                        if($this->CurrentFont['type']=='Type0')
                          $this->SJISMultiCell($w,$h,$txt,$border,$align,$fill);
                        else
                      Severity: Major
                      Found in fpdf/japanese.php and 2 other locations - About 1 hr to fix
                      fpdf/chinese.php on lines 121..127
                      fpdf/korean.php on lines 91..97

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

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

                      function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
                      {
                        if($this->CurrentFont['type']=='Type0')
                          $this->MBMultiCell($w,$h,$txt,$border,$align,$fill);
                        else
                      Severity: Major
                      Found in fpdf/korean.php and 2 other locations - About 1 hr to fix
                      fpdf/chinese.php on lines 121..127
                      fpdf/japanese.php on lines 100..106

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

                      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 Cell has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
                      Severity: Major
                      Found in fpdf/fpdf.php - About 1 hr to fix

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

                        if ($pdf_data['subsubtitle'] <> '') {
                            $pdf->WriteHTML($puff, $pdf_config['scale']);
                            $pdf->SetFont($pdf_config['font']['subsubtitle']['family'], $pdf_config['font']['subsubtitle']['style'], $pdf_config['font']['subsubtitle']['size']);
                            $pdf->WriteHTML($pdf_data['subsubtitle'], $pdf_config['scale']);
                        }
                        Severity: Minor
                        Found in makepdf.php and 1 other location - About 1 hr to fix
                        makepdf.php on lines 117..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 100.

                        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 ($pdf_data['subtitle'] <> '') {
                            $pdf->WriteHTML($puff, $pdf_config['scale']);
                            $pdf->SetFont($pdf_config['font']['subtitle']['family'], $pdf_config['font']['subtitle']['style'], $pdf_config['font']['subtitle']['size']);
                            $pdf->WriteHTML($pdf_data['subtitle'], $pdf_config['scale']);
                        }
                        Severity: Minor
                        Found in makepdf.php and 1 other location - About 1 hr to fix
                        makepdf.php on lines 122..126

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

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

                        function gif_getSize($gif, &$width, &$height)
                        {
                          if(isSet($gif) && (@get_class($gif) == 'cgif') && $gif->loaded()) {
                            $width  = $gif->width();
                            $height = $gif->height();
                        Severity: Minor
                        Found in fpdf/gif.php - About 55 mins 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 _putcatalog has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function _putcatalog()
                        {
                          $this->_out('/Type /Catalog');
                          $this->_out('/Pages 1 0 R');
                          if($this->ZoomMode=='fullpage')
                        Severity: Minor
                        Found in fpdf/fpdf.php - About 55 mins 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 mylinks_qrcode_convert_encoding has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function mylinks_qrcode_convert_encoding($str, $to = 'SJIS', $from = _CHARSET)
                        {
                            if (function_exists('mb_convert_encoding')) {
                                if (is_array($str)) {
                                    foreach ($str as $key => $val) {
                        Severity: Minor
                        Found in qrcode.php - About 55 mins 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 bookmark_convert_encoding has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function bookmark_convert_encoding($str, $to = 'SJIS', $from = _CHARSET)
                        {
                            if (function_exists('mb_convert_encoding')) {
                                if (is_array($str)) {
                                    foreach ($str as $key => $val) {
                        Severity: Minor
                        Found in bookmark.php - About 55 mins 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

                        Severity
                        Category
                        Status
                        Source
                        Language