XoopsModules25x/mylinks

View on GitHub
fpdf/font/makefont/makefont.php

Summary

Maintainability
F
4 days
Test Coverage

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

function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')
{
  //Generate a font definition file
  set_magic_quotes_runtime(0);
  ini_set('auto_detect_line_endings','1');
Severity: Minor
Found in fpdf/font/makefont/makefont.php - About 6 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 makefont.php has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*******************************************************************************
* Utility to generate font definition files                                    *
* Version: 1.13                                                                *
* Date:    2004-12-31                                                          *
Severity: Minor
Found in fpdf/font/makefont/makefont.php - About 4 hrs to fix

    Method MakeFont has 107 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')
    {
      //Generate a font definition file
      set_magic_quotes_runtime(0);
      ini_set('auto_detect_line_endings','1');
    Severity: Major
    Found in fpdf/font/makefont/makefont.php - About 4 hrs to fix

      Method ReadAFM has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ReadAFM($file,&$map)
      {
        //Read a font metric file
        $a=file($file);
        if(empty($a))
      Severity: Major
      Found in fpdf/font/makefont/makefont.php - About 3 hrs to fix

        Function MakeFontDescriptor has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function MakeFontDescriptor($fm,$symbolic)
        {
          //Ascent
          $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
          $fd="array('Ascent'=>".$asc;
        Severity: Minor
        Found in fpdf/font/makefont/makefont.php - About 1 hr 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 MakeFontDescriptor has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function MakeFontDescriptor($fm,$symbolic)
        {
          //Ascent
          $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
          $fd="array('Ascent'=>".$asc;
        Severity: Minor
        Found in fpdf/font/makefont/makefont.php - About 1 hr to fix

          Method CheckTTF has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function CheckTTF($file)
          {
            //Check if font license allows embedding
            $f=fopen($file,'rb');
            if(!$f)
          Severity: Minor
          Found in fpdf/font/makefont/makefont.php - About 1 hr to fix

            Function MakeWidthArray has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function MakeWidthArray($fm)
            {
              //Make character width array
              $s="array(\n\t";
              $cw=$fm['Widths'];
            Severity: Minor
            Found in fpdf/font/makefont/makefont.php - About 1 hr 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 MakeFont has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')
            Severity: Minor
            Found in fpdf/font/makefont/makefont.php - About 35 mins to fix

              Function CheckTTF has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function CheckTTF($file)
              {
                //Check if font license allows embedding
                $f=fopen($file,'rb');
                if(!$f)
              Severity: Minor
              Found in fpdf/font/makefont/makefont.php - About 35 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 ReadMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function ReadMap($enc)
              {
                //Read a map file
                $file=__DIR__.'/'.strtolower($enc).'.map';
                $a=file($file);
              Severity: Minor
              Found in fpdf/font/makefont/makefont.php - About 35 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 MakeFontEncoding has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function MakeFontEncoding($map)
              {
                //Build differences from reference encoding
                $ref=ReadMap('cp1252');
                $s='';
              Severity: Minor
              Found in fpdf/font/makefont/makefont.php - About 25 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

              There are no issues that match your filters.

              Category
              Status