XoopsModules25x/mylinks

View on GitHub
fpdf/korean.php

Summary

Maintainability
F
3 wks
Test Coverage

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

function _putfonts()
{
  $nf=$this->n;
  foreach($this->diffs as $diff)
  {
Severity: Minor
Found in fpdf/korean.php - About 7 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 MBMultiCell has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
{
  //Multi-byte version of MultiCell()
  $cw=&$this->CurrentFont['cw'];
  if($w==0)
Severity: Minor
Found in fpdf/korean.php - About 5 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 korean.php has 378 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
if (!defined('XOOPS_ROOT_PATH')) {
  die('XOOPS root path not defined');
}

Severity: Minor
Found in fpdf/korean.php - About 5 hrs to fix

    Function MBWrite has a Cognitive Complexity of 29 (exceeds 5 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: Minor
    Found in fpdf/korean.php - About 4 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 MBMultiCell has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
    {
      //Multi-byte version of MultiCell()
      $cw=&$this->CurrentFont['cw'];
      if($w==0)
    Severity: Major
    Found in fpdf/korean.php - About 3 hrs to fix

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

      function _putfonts()
      {
        $nf=$this->n;
        foreach($this->diffs as $diff)
        {
      Severity: Major
      Found in fpdf/korean.php - About 3 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 _putType0 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _putType0($font)
          {
            //Type0
            $this->_out('/Subtype /Type0');
            $this->_out('/BaseFont /'.$font['name'].'-'.$font['CMap']);
          Severity: Minor
          Found in fpdf/korean.php - About 1 hr 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/korean.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/korean.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

                  Method AddCIDFonts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function AddCIDFonts($family,$name,$cw,$CMap,$registry)
                  Severity: Minor
                  Found in fpdf/korean.php - About 35 mins to fix

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

                    function MBMultiCell($w,$h,$txt,$border=0,$align='L',$fill=0)
                    {
                      //Multi-byte version of MultiCell()
                      $cw=&$this->CurrentFont['cw'];
                      if($w==0)
                    Severity: Major
                    Found in fpdf/korean.php and 1 other location - About 4 days to fix
                    fpdf/chinese.php on lines 129..223

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

                    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 _putfonts()
                    {
                      $nf=$this->n;
                      foreach($this->diffs as $diff)
                      {
                    Severity: Major
                    Found in fpdf/korean.php and 2 other locations - About 4 days to fix
                    fpdf/chinese.php on lines 316..411
                    fpdf/japanese.php on lines 332..427

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

                    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 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 and 1 other location - About 4 days to fix
                    fpdf/chinese.php on lines 233..314

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

                    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

                    function AddCIDFont($family,$style,$name,$cw,$CMap,$registry)
                    {
                      $fontkey=strtolower($family).strtoupper($style);
                      if(isset($this->fonts[$fontkey]))
                        $this->Error("Font already added: $family $style");
                    Severity: Major
                    Found in fpdf/korean.php and 1 other location - About 4 hrs to fix
                    fpdf/chinese.php on lines 32..40

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

                    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/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 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

                    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

                    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

                    There are no issues that match your filters.

                    Category
                    Status