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))
- Read upRead up
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');
- Read upRead up
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 *
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');
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))
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;
- Read upRead up
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;
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)
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'];
- Read upRead up
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')
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)
- Read upRead up
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);
- Read upRead up
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='';
- Read upRead up
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"