Showing 15 of 15 total issues
Builder
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Builder
{
/** @var string */
protected $appName = 'UNKNOWN';
RemoteAccessPolicy
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class RemoteAccessPolicy
{
/** @var bool */
private $publicIpRangesDenied = false;
Function createOrUpdateServiceDefinition
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function createOrUpdateServiceDefinition(ContainerBuilder $container)
{
// First check if the console service is already registered.
// This code will sure to give preference to user registered services.
if ($container->hasDefinition($this->serviceIdentifier)) {
- 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 __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $routeMatch)
{
// Get the route params + route match properties
foreach ($routeMatch as $key => $value) {
if ($this->isClassMember($key)) {
- 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 invoke
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function invoke(RouteMatch $routeMatch, Request $request)
{
// Set route match & request
$this->request = $request;
$this->routeMatch = $routeMatch;
- 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 getRealPaths
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getRealPaths()
{
$directories = [];
$rootDir = $this->projectDir ?: getcwd();
foreach ($this->getConfigDirs() as $path) {
- 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 verifyClient
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function verifyClient(Request $request)
{
// Declare vars
$clientIp = $request->getClientIp();
$host = $request->getHost();
- 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 createOrUpdateServiceDefinition
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createOrUpdateServiceDefinition(ContainerBuilder $container)
{
// First check if the console service is already registered.
// This code will sure to give preference to user registered services.
if ($container->hasDefinition($this->serviceIdentifier)) {
Function loadConfiguration
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function loadConfiguration($resourceDir)
{
// Create xml loader
$loader = new XmlFileLoader($this->serviceContainer, new FileLocator($resourceDir));
- 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 moveAll
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function moveAll($targetDir, $files, $overwrite = false)
{
if (self::isDir($targetDir)) {
$fs = new Filesystem();
foreach ($files as $file) {
- 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
Consider simplifying this complex logical expression. Open
if ($this->isPublicIpRangesDenied() && NetworkUtils::isPublicIpRange($clientIp)
|| $this->isPrivateIpRangesDenied() && NetworkUtils::isPrivateIpRange($clientIp)
|| $this->isReservedIpRangesDenied() && NetworkUtils::isReservedIpRange($clientIp)) {
// Access denied!
$accessGranted = false;
Method findByExtension
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function findByExtension($dir, $extension, $recursive = true, $followLinks = false, $filePattern = '*')
Function createDirIfNotExists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function createDirIfNotExists($path, $mode = 0777, $recursive = true)
{
// Check if the given path is a directory.
if (!is_dir($path)) {
if (file_exists($path)) {
- 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 loadConfigurations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function loadConfigurations($directories)
{
// Load configurations
if (is_array($directories)) {
foreach ($directories as $directory) {
- 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 loadCompilerPasses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function loadCompilerPasses($compilerPasses)
{
// Load compiler passes
if (is_array($compilerPasses)) {
foreach ($compilerPasses as list($pass, $type)) {
- 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"