Showing 25 of 25 total issues
Function checkFileInternal
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
$this->setIndentStyle($config->get('style', $this->indentStyle));
- 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
Function checkFileInternal
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
$lines = $file->getLines();
- 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
Function navigateToKey
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function &navigateToKey($key, $createSections)
{
$current = &$this->array;
foreach (explode('.', $key) as $key) {
if (!is_array($current)) {
- 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
Method checkFileInternal
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
$this->setIndentStyle($config->get('style', $this->indentStyle));
- Create a ticketCreate a ticket
Method checkFileInternal
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
if (!function_exists('mb_detect_encoding')) {
- Create a ticketCreate a ticket
Method checkFileInternal
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
$lines = $file->getLines();
- Create a ticketCreate a ticket
Function mergeRecursive
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function mergeRecursive($array1, $array2)
{
$result = [];
foreach (array_merge(array_keys($array1), array_keys($array2)) as $key) {
if (!isset($array1[$key])) {
- 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
Function processArgContainer
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function processArgContainer(ArgContainer $argContainer)
{
$mappings = $this->buildArgMappings();
foreach ($argContainer->getAllOptions() as $argName => $argValue) {
- 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
Method addCheckResults
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addCheckResults(File $file, array $checkResults)
{
if (empty($this->loggedSeverities)) {
return;
}
- Create a ticketCreate a ticket
Function addCheckResults
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function addCheckResults(File $file, array $checkResults)
{
if (empty($this->loggedSeverities)) {
return;
}
- 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
Method checkFileInternal
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
$tokens = $checkContext->getTokenList();
- Create a ticketCreate a ticket
Method checkFileInternal
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
$tokens = $checkContext->getTokenList();
- Create a ticketCreate a ticket
Function load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function load($config, $filename = false)
{
if ($filename) {
$included = [$this->normalizeConfigName($filename)];
} else {
- 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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Environment $environment,
FileSystem $fileSystem,
CheckRepository $checkRepository,
ConfigReaderInterface $configReader,
$pathToSelf,
- Create a ticketCreate a ticket
Function extractNextLine
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function extractNextLine($source, array $eols, &$eolUsed)
{
$minIndex = false;
$eolUsed = null;
foreach ($eols as $eol) {
- 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
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(File $file, $line, $column, $severity, $message)
- Create a ticketCreate a ticket
Method addViolation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addViolation(File $file, $line, $column, $message, $severity = null)
- Create a ticketCreate a ticket
Function checkFileInternal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
if (!function_exists('mb_detect_encoding')) {
- 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
Function putContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function putContent($path, $content)
{
$isStream = strpos($path, 'php://') !== false;
if (!$isStream) {
- 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
Function checkFileInternal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function checkFileInternal(CheckContext $checkContext, Config $config)
{
$file = $checkContext->getFile();
$lines = $file->getLines();
- 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"