polyfony-inc/polyfony

View on GitHub
Private/Polyfony/Entity/Aware.php

Summary

Maintainability
C
7 hrs
Test Coverage

File Aware.php has 253 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
 
namespace Polyfony\Entity;
use Polyfony\Exception as Exception;
use Polyfony\Query\Convert as Convert;
Severity: Minor
Found in Private/Polyfony/Entity/Aware.php - About 2 hrs to fix

Method save has 32 lines of code (exceeds 25 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 1 hr to fix

Method set has 32 lines of code (exceeds 25 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 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

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 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 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

There are no issues that match your filters.

Category
Status