XoopsModules25x/mylinks

View on GitHub

Showing 370 of 370 total issues

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

function b_system_waiting_show()
{
    global $xoopsUser;
    $xoopsDB        = XoopsDatabaseFactory::getDatabaseConnection();
    $moduleHandler = xoops_getHandler('module');
Severity: Major
Found in extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php - About 3 hrs to fix

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

    function convertorderbyout($orderby)
    {
        $orderby = (isset($orderby) && ('' != trim($orderby))) ? trim($orderby) : '';
        switch ($orderby) {
            case 'title ASC':
    Severity: Major
    Found in include/functions.php and 1 other location - About 3 hrs to fix
    include/functions.php on lines 78..110

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

    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

    function convertorderbyin($orderby)
    {
        $orderby = (isset($orderby) && ('' != trim($orderby))) ? trim($orderby) : '';
        switch ($orderby) {
            case 'titleA':
    Severity: Major
    Found in include/functions.php and 1 other location - About 3 hrs to fix
    include/functions.php on lines 154..186

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

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

    function FPDF($orientation='P',$unit='mm',$format='A4')
    {
      //Some checks
      $this->_dochecks();
      //Initialization of properties
    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 b_system_info_show has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    function b_system_info_show($options)
    {
        global $xoopsConfig, $xoopsUser;
        $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
        $myts    = MyTextSanitizer::getInstance();
    Severity: Minor
    Found in extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.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 renderImageNav has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        public function renderImageNav($offset = 5)
        {
            if ($this->total < $this->perpage) {
                return;
            }
    Severity: Minor
    Found in class/mylinkspagenav.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 setShotSize has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        public function setShotSize($sz)
        {
            $validX  = array(90, 120, 200, 400, 480);
            $validY  = array(68, 90, 150, 300, 360);
            $sizeMap = array(0 => 't', 1 => 's', 2 => 'm', 3 => 'l', 4 => 'x');
    Severity: Minor
    Found in class/providers/pagepeeker.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 renderNav has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        public function renderNav($offset = 5)
        {
            $ret = '';
            if ($this->total <= $this->perpage) {
                return $ret;
    Severity: Minor
    Found in class/mylinkspagenav.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 getBmp has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function getBmp($bgColor)
      {
        $out = '';
    
        if(!$this->m_bLoaded) {
    Severity: Major
    Found in fpdf/gif.php - About 3 hrs to fix

      File bookmark.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      include __DIR__ . '/header.php';
      include_once __DIR__ . '/class/utility.php';
      //xoops_load('utility', $xoopsModule->getVar('dirname'));
      Severity: Minor
      Found in bookmark.php - About 3 hrs to fix

        Method listModReq has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function listModReq()
        {
            global $xoopsDB, $myts, $xoopsModuleConfig, $xoopsModule;
        
            $result           = $xoopsDB->query('SELECT requestid, lid, cid, title, url, logourl, description, modifysubmitter FROM ' . $xoopsDB->prefix('mylinks_mod') . ' ORDER BY requestid');
        Severity: Major
        Found in admin/main.php - About 3 hrs to fix

          Function listModReq has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

          function listModReq()
          {
              global $xoopsDB, $myts, $xoopsModuleConfig, $xoopsModule;
          
              $result           = $xoopsDB->query('SELECT requestid, lid, cid, title, url, logourl, description, modifysubmitter FROM ' . $xoopsDB->prefix('mylinks_mod') . ' ORDER BY requestid');
          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 delCat has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

          function delCat()
          {
              global $xoopsDB, $myCatTree, $xoopsModule, $xoopsUser;
          
              $cid = MylinksUtility::mylinks_cleanVars($_REQUEST, 'cid', 0, 'int', array('min' => 0));
          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 getPng has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function getPng($bgColor)
            {
              $out = '';
          
              if(!$this->m_bLoaded) {
          Severity: Major
          Found in fpdf/gif.php - About 3 hrs to fix

            Method modLink has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function modLink()
            {
                global $xoopsDB, $myts, $myCatTree, $xoopsModule;
            
                $linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/images/shots/');
            Severity: Major
            Found in admin/main.php - About 3 hrs to fix

              Method diff has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function diff($from_lines, $to_lines)
                  {
                      $n_from = count($from_lines);
                      $n_to   = count($to_lines);
              
              
              Severity: Major
              Found in class/Text_Diff.php - About 3 hrs to fix

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

                    if (xoops_isActiveModule('smartsection') && $moduleHandler->getCount(new Criteria('dirname', 'smartsection'))) {
                        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('smartsection_items') . ' WHERE status=1');
                        if ($result) {
                            $block['modules'][10]['adminlink'] = XOOPS_URL . '/modules/smartsection/admin/item.php';
                            list($block['modules'][10]['pendingnum']) = $xoopsDB->fetchRow($result);
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 214..221
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 279..286
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 289..296

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

                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

                    if (xoops_isActiveModule('extgallery') && $moduleHandler->getCount(new Criteria('dirname', 'extgallery'))) {
                        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('extgallery_publicphoto') . ' WHERE photo_approved=0');
                        if ($result) {
                            $block['modules'][9]['adminlink'] = XOOPS_URL . '/modules/extgallery/admin/photo.php#pending-photo';
                            list($block['modules'][9]['pendingnum']) = $xoopsDB->fetchRow($result);
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 214..221
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 279..286
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 299..306

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

                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

                    if (xoops_isActiveModule('news') && $moduleHandler->getCount(new Criteria('dirname', 'news'))) {
                        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('stories') . ' WHERE published=0');
                        if ($result) {
                            $block['modules'][0]['adminlink'] = XOOPS_URL . '/modules/news/admin/index.php?op=newarticle';
                            list($block['modules'][0]['pendingnum']) = $xoopsDB->fetchRow($result);
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 279..286
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 289..296
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 299..306

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

                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

                    if (xoops_isActiveModule('TDMdownloads') && $moduleHandler->getCount(new Criteria('dirname', 'TDMDownloads'))) {
                        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('tdmdownloads_downloads') . ' WHERE status=0');
                        if ($result) {
                            $block['modules'][8]['adminlink'] = XOOPS_URL . '/modules/TDMDownloads/admin/downloads.php?op=list&statut_display=0';
                            list($block['modules'][8]['pendingnum']) = $xoopsDB->fetchRow($result);
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 214..221
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 289..296
                extras/XOOPS_2.5.x/htdocs/modules/system/blocks/system_blocks.php on lines 299..306

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

                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

                Severity
                Category
                Status
                Source
                Language