XoopsModules25x/mylinks

View on GitHub

Showing 370 of 370 total issues

Function setShotSize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function setShotSize($sz)
    {
        if (is_array($sz)) {
            if (array_key_exists('width', $sz)) {
                $this->image_width = (int)$sz['width'];
Severity: Minor
Found in class/providers/nemui.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 getCatTitles has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCatTitles($cats = null)
    {
        $catTitles = array();
        $criteria  = new CriteriaCompo();
        if (isset($cats) && is_array($cats)) {
Severity: Minor
Found in class/Category.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 issue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        public function issue($salt = '', $timeout = 1800, $area = '')
        {
            global $xoopsModule;

            if ('' === $salt) {
Severity: Minor
Found in include/gtickets.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

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

  if(($r==0 && $g==0 && $b==0) || $g==-1)
    $this->DrawColor=sprintf('%.3f G',$r/255);
  else
    $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);
Severity: Major
Found in fpdf/fpdf.php and 2 other locations - About 55 mins to fix
fpdf/fpdf.php on lines 408..411
fpdf/fpdf.php on lines 420..423

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

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

  if(($r==0 && $g==0 && $b==0) || $g==-1)
    $this->FillColor=sprintf('%.3f g',$r/255);
  else
    $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
Severity: Major
Found in fpdf/fpdf.php and 2 other locations - About 55 mins to fix
fpdf/fpdf.php on lines 397..400
fpdf/fpdf.php on lines 420..423

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

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

  if(($r==0 && $g==0 && $b==0) || $g==-1)
    $this->TextColor=sprintf('%.3f g',$r/255);
  else
    $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
Severity: Major
Found in fpdf/fpdf.php and 2 other locations - About 55 mins to fix
fpdf/fpdf.php on lines 397..400
fpdf/fpdf.php on lines 408..411

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

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 AddBig5hwFont($family='PMingLiU',$name='MSungStd-Light-Acro')
{
  //Add Big5 font with half-witdh Latin
  for($i=32;$i<=126;$i++)
    $cw[chr($i)]=500;
Severity: Major
Found in fpdf/chinese.php and 2 other locations - About 55 mins to fix
fpdf/chinese.php on lines 78..86
fpdf/korean.php on lines 48..56

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

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 AddGBhwFont($family='GB-hw',$name='STSongStd-Light-Acro')
{
  //Add GB font with half-width Latin
  for($i=32;$i<=126;$i++)
    $cw[chr($i)]=500;
Severity: Major
Found in fpdf/chinese.php and 2 other locations - About 55 mins to fix
fpdf/chinese.php on lines 59..67
fpdf/korean.php on lines 48..56

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

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 AddUHChwFont($family='UHC-hw',$name='HYSMyeongJoStd-Medium-Acro')
{
  //Add UHC font with half-witdh Latin
  for($i=32;$i<=126;$i++)
    $cw[chr($i)]=500;
Severity: Major
Found in fpdf/korean.php and 2 other locations - About 55 mins to fix
fpdf/chinese.php on lines 59..67
fpdf/chinese.php on lines 78..86

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

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

function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')
Severity: Major
Found in fpdf/fpdf.php - About 50 mins to fix

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

          else {
            mlelestyle.display = "block";
             mlimgele.src = targeturl+'/minimize.gif';
             mlimgele.alt = 'Click me if you want to minimize this block';
             mlimgele.title = 'Click me if you want to minimize this block';
    Severity: Minor
    Found in include/mylinks.js and 1 other location - About 50 mins to fix
    include/mylinks.js on lines 5..10

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

    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 (mlelestyle.display == "block") {
            mlelestyle.display = "none";
             mlimgele.src = targeturl+'/restore.gif';
             mlimgele.alt = 'Click me if you want to restore this block';
             mlimgele.title = 'Click me if you want to restore this block';
    Severity: Minor
    Found in include/mylinks.js and 1 other location - About 50 mins to fix
    include/mylinks.js on lines 11..16

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

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

    function SJISMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
    Severity: Minor
    Found in fpdf/japanese.php - About 45 mins to fix

      Method AddCIDFont has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function AddCIDFont($family,$style,$name,$cw,$CMap,$registry)
      Severity: Minor
      Found in fpdf/japanese.php - About 45 mins to fix

        Method MultiCell has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
        Severity: Minor
        Found in fpdf/korean.php - About 45 mins to fix

          Function b_system_topposters_edit has a Cognitive Complexity of 8 (exceeds 5 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 45 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

          Method AddCIDFont has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function AddCIDFont($family,$style,$name,$cw,$CMap,$registry)
          Severity: Minor
          Found in fpdf/chinese.php - About 45 mins to fix

            Method MultiCell has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
            Severity: Minor
            Found in fpdf/chinese.php - About 45 mins to fix

              Method MultiCell has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function MultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
              Severity: Minor
              Found in fpdf/japanese.php - About 45 mins to fix

                Method MBMultiCell has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
                Severity: Minor
                Found in fpdf/chinese.php - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language