polyfony-inc/polyfony

View on GitHub

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) {
Severity: Minor
Found in Private/Polyfony/Response/HTML.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 slug has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function slug(
        $string
    ) :string {
        // accentuated characters
        $with = preg_split(
Severity: Minor
Found in Private/Polyfony/Format.php - About 1 hr to fix

Method autoPopulate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function autoPopulate(
        string $when
    ) :void {
        
        // for each column to autopopulate
Severity: Minor
Found in Private/Polyfony/Entity/Aware.php - About 1 hr to fix

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',[
Severity: Minor
Found in Private/Polyfony/Profiler/HTML/Timing.php - About 1 hr to fix

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
    ) {
Severity: Minor
Found in Private/Polyfony/Query/Convert.php - About 1 hr to fix

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();
Severity: Minor
Found in Private/Polyfony/Profiler/HTML/Security.php - About 55 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 autoPopulate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function autoPopulate(
        string $when
    ) :void {
        
        // for each column to autopopulate
Severity: Minor
Found in Private/Polyfony/Entity/Aware.php - About 55 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 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
Severity: Minor
Found in Private/Polyfony/Response/HTML.php - About 55 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 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) {
Severity: Minor
Found in Private/Polyfony/Element.php - About 55 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 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
    ) {
Severity: Minor
Found in Private/Polyfony/Query/Convert.php - About 45 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 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
Severity: Minor
Found in Private/Polyfony/Emails.php - About 45 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 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);
Severity: Minor
Found in Private/Polyfony/Query/Convert.php - About 45 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 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
Severity: Minor
Found in Private/Polyfony/Entity/Aware.php - About 45 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 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 {
Severity: Minor
Found in Private/Polyfony/Form/Integrity.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 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'),
Severity: Minor
Found in Private/Polyfony/Database.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 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
Severity: Minor
Found in Private/Polyfony/Bundles.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 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=[]
Severity: Minor
Found in Private/Polyfony/Form.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

Avoid too many return statements within this method.
Open

                    return false;
Severity: Major
Found in Private/Polyfony/Route.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return false;
Severity: Major
Found in Private/Polyfony/Route.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return false;
Severity: Major
Found in Private/Polyfony/Route.php - About 30 mins to fix
Severity
Category
Status
Source
Language