Showing 84 of 84 total issues
File Route.php
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Polyfony;
class Route {
- Create a ticketCreate a ticket
Function buildQuery
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function buildQuery() :void {
// if the action is missing
if(!$this->Action) { Throw new Exception('Query->buildQuery() : Missing action'); }
// if action anything but query
- 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
Query
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Query extends Query\Conditions {
// debugging methods (for the Profiler)
public function getQuery() {
return $this->Query;
- Create a ticketCreate a ticket
Filter
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Filter {
const FILTERS_TO_METHODS_MAP = [
'capslock30'=>'toUppercaseSafe30Percent',
'capslock50'=>'toUppercaseSafe50Percent',
- Create a ticketCreate a ticket
Function validateThisParameter
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function validateThisParameter(
$parameter_index,
$parameter_value
) :bool {
// if a constraint exists for a parameter in that position
- 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
File Emails.php
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Polyfony;
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
- Create a ticketCreate a ticket
Response
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Response {
// set manually
protected static $_content; // raw content before internal formatting
protected static string $_type; // type of the output (html/json/…)
- Create a ticketCreate a ticket
File Query.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Polyfony;
use \PDO;
use Polyfony\Query\Convert as Convert;
- Create a ticketCreate a ticket
Function log
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private static function log(
int $level,
$message,
$context = null
) :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
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
File Response.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Polyfony;
class Response {
- Create a ticketCreate a ticket
Request
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Request {
private static $_url;
private static $_get;
private static $_post;
- Create a ticketCreate a ticket
Route
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Route {
// url to match
public ?string $url = null;
// name of that route
- Create a ticketCreate a ticket
Method buildQuery
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildQuery() :void {
// if the action is missing
if(!$this->Action) { Throw new Exception('Query->buildQuery() : Missing action'); }
// if action anything but query
- Create a ticketCreate a ticket
Method formatContent
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function formatContent() :void {
// base headers
$headers = [];
// case of html page
if(self::$_type == 'html-page') {
- Create a ticketCreate a ticket
Function formatContent
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static function formatContent() :void {
// base headers
$headers = [];
// case of html page
if(self::$_type == 'html-page') {
- 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
Emails
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Emails extends Entity {
const recipients_types_to_phpmailer_methods = [
'to' =>'addAddress',
'cc' =>'addCC',
- Create a ticketCreate a ticket
Function hasValidSignature
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function hasValidSignature(
array $request_parameters_indexed_by_position
) :bool {
// if the route needs a signature to be a match
- 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
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;
- Create a ticketCreate a ticket
Method validateThisParameter
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateThisParameter(
$parameter_index,
$parameter_value
) :bool {
// if a constraint exists for a parameter in that position
- Create a ticketCreate a ticket