File HTML.php
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Polyfony\Response;
use Polyfony\{
- Create a ticketCreate a ticket
Function packAndMinifyScripts
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private static function packAndMinifyScripts() :void {
// if we are allowed to pack js files
if(self::isPackingOfTheseAssetsAllowed('js')) {
// generate a unique name for a pack that contains that list of scripts only
list(
- Read upRead up
- Create a ticketCreate a ticket
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 setLinks
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setLinks(
array $links,
bool $replace_existing=false
) :void {
// if we want to purge existing links
- Create a ticketCreate a ticket
Method packAndMinifyScripts
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function packAndMinifyScripts() :void {
// if we are allowed to pack js files
if(self::isPackingOfTheseAssetsAllowed('js')) {
// generate a unique name for a pack that contains that list of scripts only
list(
- Create a ticketCreate a ticket
Function packAndMinifyLinks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function packAndMinifyLinks() :void {
// if we are allowed to pack js files
if(self::isPackingOfTheseAssetsAllowed('css')) {
// now that we have sorted links by type and medias, we can pack them by medias
foreach(self::getStylesheetsLinksSortedByMedia() as $media => $list_of_stylesheets) {
- Read upRead up
- Create a ticketCreate a ticket
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 setLinks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function setLinks(
array $links,
bool $replace_existing=false
) :void {
// if we want to purge existing links
- Read upRead up
- Create a ticketCreate a ticket
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"