Showing 30 of 38 total issues
Database
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Database
extends AbstractService
{
/**
* Holds the PDO handler
App
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class App
extends Container
{
/**
* Holds application working directory
Server
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Server
extends AbstractService
implements InterfaceServer
{
/**
Function listen
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function listen()
{
// Set default values
$result = false;
$matches = array();
- Read upRead up
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 getRequestFromGlobals
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRequestFromGlobals($server, $params)
{
if (empty($server['REQUEST_METHOD'])) {
return false;
}
Function seedFromConfig
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function seedFromConfig()
{
// Begin transation
$this->pdo->beginTransaction();
- Read upRead up
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 send
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send(\Closure $callback)
{
$mail = new PHPMailer;
// Setup SMTP
Method connect
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function connect($host, $username, $password = '', $port = 22)
{
// Start connection
if (!($this->connection = @ssh2_connect($host, $port))) {
throw new DualityException(
Method listen
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listen()
{
// Set default values
$result = false;
$matches = array();
Method init
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
if (!extension_loaded('intl')) {
throw new DualityException(
"Error: intl extension not loaded",
Method init
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
$this->pretend = false;
$this->current = new Storage;
$this->smtp = new Storage;
Method setLocale
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setLocale($code, $timezone = 'Europe/Lisbon')
{
$this->current = \Locale::canonicalize($code);
// Validate locale and translations directory
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(Request &$request)
{
$this->init();
$header = array();
$reqHeaders = $request->getHeaders();
Function updateFromConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function updateFromConfig()
{
// Begin transation
$this->pdo->beginTransaction();
- Read upRead up
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 connect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function connect($host, $username, $password = '', $port = 22)
{
// Start connection
if (!($this->connection = @ssh2_connect($host, $port))) {
throw new DualityException(
- Read upRead up
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 getSelect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0
Method setSMTP
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$host, $user = '', $pass = '', $encr = 'tls', $port = 587, $debugLevel = 0
Method connectSSH
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$host,
$username,
$password = '',
$port = 22,
$paraphrase = null,
Method getSelect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0
Function send
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function send(\Closure $callback)
{
$mail = new PHPMailer;
// Setup SMTP
- Read upRead up
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"