Showing 7 of 7 total issues
Function fitsPattern
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function fitsPattern($path, $pattern)
{
$path = explode('/', $path);
$pattern = explode('/', $pattern);
- 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 checkModifications
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function checkModifications()
{
foreach ($this->jsonDiff->getModifiedPaths() as $path) {
$original = JsonPointer::getByPointer($this->original, $path);
$new = JsonPointer::getByPointer($this->new, $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
Method checkModifications
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkModifications()
{
foreach ($this->jsonDiff->getModifiedPaths() as $path) {
$original = JsonPointer::getByPointer($this->original, $path);
$new = JsonPointer::getByPointer($this->new, $path);
Function checkAdditions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkAdditions()
{
foreach ($this->jsonDiff->getAddedPaths() as $path) {
$new = JsonPointer::getByPointer($this->new, $path);
switch (true) {
- 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
Avoid too many return
statements within this method. Open
return true;
Function checkRemovals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function checkRemovals()
{
foreach ($this->jsonDiff->getRemovedPaths() as $path) {
$original = JsonPointer::getByPointer($this->original, $path);
switch (true) {
- 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 performAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function performAction()
{
$originalJson = file_get_contents($this->originalPath);
if (!$originalJson) {
$this->response->error('Unable to read ' . $this->originalPath);
- 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"