Showing 69 of 84 total issues
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
Method slug
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function slug(
$string
) :string {
// accentuated characters
$with = preg_split(
- Create a ticketCreate a ticket
Method autoPopulate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function autoPopulate(
string $when
) :void {
// for each column to autopopulate
- Create a ticketCreate a ticket
Method getLegend
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getLegend() :array {
// the general legend for the waterfall graphics
$legend=[];
$legend[] = new Element('span',[
- Create a ticketCreate a ticket
Method valueFromDatabase
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function valueFromDatabase(
$column_name,
$raw_value,
$get_it_raw=false
) {
- Create a ticketCreate a ticket
Function getBody
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function getBody(
Dropdown $security_dropdown
) : Dropdown {
$account = \Polyfony\Security::getAccount();
- 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 autoPopulate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function autoPopulate(
string $when
) :void {
// for each column to autopopulate
- 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"
Further reading
Function set
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function set($attribute, $value=null) :self {
// array is passed
if(is_array($attribute)) {
// for each associative value in the array
foreach($attribute as $single_attribute => $single_value) {
- 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 valueFromDatabase
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function valueFromDatabase(
$column_name,
$raw_value,
$get_it_raw=false
) {
- 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 setIncludingFakeColumns
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function setIncludingFakeColumns(
string $column,
$value
) :void {
// if the body is an array, we assume it's a list of variables
- 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 valueForDatabase
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function valueForDatabase(string $column, $value) {
// if we find a serialization keyword
if(strpos($column,'_array') !== false) {
// encode the content as JSON, being it array, null, false, whatever
$value = json_encode($value);
- 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 set
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function set(
$column_or_array,
$value = null
) {
// if we want to set a batch of values
- 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 enforceFor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function enforceFor(
string $variable_name,
array $error_messages,
bool $prevent_redirection = false
) :void {
- 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 configureAndGetDSN
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function configureAndGetDSN() :string {
// alter the configuration
self::$_config = array(
'driver' => Config::get('database','driver'),
- 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 getLocales
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getLocales(string $bundle) :array {
// declare an array to hold the list
$locales = array();
// set the locales path
- 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 select
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function select(
string $name,
array $select_options=[],
$selected_value=null,
array $attributes=[]
- 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
Avoid too many return
statements within this method. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return false;
- Create a ticketCreate a ticket