Function moveInto
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function moveInto($targetName, $fullSourcePath, INode $sourceNode) {
if (!$sourceNode instanceof Node) {
if ($sourceNode instanceof ITrashBinNode) {
if (!$this->fileView->isCreatable($this->getPath())) {
throw new SabreForbidden('Destination directory is not writable');
- 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
File Directory.php
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Bart Visscher <bartv@thisnet.nl>
* @author Björn Schießle <bjoern@schiessle.org>
Method moveInto
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function moveInto($targetName, $fullSourcePath, INode $sourceNode) {
if (!$sourceNode instanceof Node) {
if ($sourceNode instanceof ITrashBinNode) {
if (!$this->fileView->isCreatable($this->getPath())) {
throw new SabreForbidden('Destination directory is not writable');
Function createFile
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function createFile($name, $data = null) {
# the check here is necessary, because createFile uses put covered in sabre/file.php
# and not touch covered in files/view.php
if (Filesystem::isForbiddenFileOrDir($name)) {
throw new SabreForbidden();
- 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 createFile
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createFile($name, $data = null) {
# the check here is necessary, because createFile uses put covered in sabre/file.php
# and not touch covered in files/view.php
if (Filesystem::isForbiddenFileOrDir($name)) {
throw new SabreForbidden();
Function getChild
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getChild($name, $info = null) {
if (!$this->info->isReadable()) {
// avoid detecting files through this way
throw new SabreNotFound();
}
- 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 createDirectory
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createDirectory($name) {
# the check here is necessary, because createDirectory does not use the methods in files/view.php
if (Filesystem::isForbiddenFileOrDir($name)) {
throw new SabreForbidden();
}
Method getChild
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getChild($name, $info = null) {
if (!$this->info->isReadable()) {
// avoid detecting files through this way
throw new SabreNotFound();
}
Function createDirectory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function createDirectory($name) {
# the check here is necessary, because createDirectory does not use the methods in files/view.php
if (Filesystem::isForbiddenFileOrDir($name)) {
throw new SabreForbidden();
}
- 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 delete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function delete() {
if ($this->path === '' || $this->path === '/' || !$this->info->isDeletable()) {
throw new SabreForbidden();
}
- 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"