polyfony-inc/polyfony

View on GitHub

Showing 69 of 84 total issues

Avoid too many return statements within this method.
Open

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

Avoid too many return statements within this method.
Open

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

Avoid too many return statements within this method.
Open

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

Function whereIn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function whereIn(array $conditions, bool $invert=false) :self {
        // for each provided strict condition
        foreach($conditions as $column => $values) {
            // if we have to conditions
            if(!is_array($values) || empty($values)) {
Severity: Minor
Found in Private/Polyfony/Query/Conditions.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

Function detectActionAndTable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function detectActionAndTable() {
        // detetect the action
        $action = substr($this->Query, 0, 6);
        // if action can alter a table (INSERT, UPDATE, DELETE)
        if(in_array($action, array('INSERT', 'UPDATE', 'DELETE', 'SELECT'))) {
Severity: Minor
Found in Private/Polyfony/Query.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

Function save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function save() :bool {
        
        // if nothing has changed on this object
        if(!count($this->_['altered'])) {
            // we consider the object saved without touching the database
Severity: Minor
Found in Private/Polyfony/Entity/Aware.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

Function duration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function duration(
        int $seconds = null, 
        int $precision = 0
    ) :string {

Severity: Minor
Found in Private/Polyfony/Format.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

Function authenticateByForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function authenticateByForm() :void {
        
        // look for users with this login
        $account = \Models\Accounts::getByLogin(
            Request::post( Config::get('security', 'login') )
Severity: Minor
Found in Private/Polyfony/Security.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

Function deduceAttributesFromFilters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function deduceAttributesFromFilters(string $column) :array {

        // default attributes
        $attributes = [];

Severity: Minor
Found in Private/Polyfony/Entity/Form.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

Severity
Category
Status
Source
Language