Showing 23 of 23 total issues
File AmazonS3Driver.php
has 975 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/***
*
* This file is part of an extension for TYPO3 CMS.
AmazonS3Driver
has 74 functions (exceeds 20 allowed). Consider refactoring. Open
class AmazonS3Driver extends AbstractHierarchicalFilesystemDriver implements StreamableDriverInterface
{
const DRIVER_TYPE = 'AusDriverAmazonS3';
const EXTENSION_KEY = 'aus_driver_amazon_s3';
Function getFoldersInFolder
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function getFoldersInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = false, array $folderNameFilterCallbacks = [], $sort = '', $sortRev = false)
{
$this->normalizeIdentifier($folderIdentifier);
$folders = [];
- 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 getObjectPermissions
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function getObjectPermissions($identifier)
{
$this->normalizeIdentifier($identifier);
if ($identifier === '') {
$identifier = self::ROOT_FOLDER_IDENTIFIER;
- 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 getFilesInFolder
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getFilesInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = false, array $filenameFilterCallbacks = [], $sort = '', $sortRev = false)
{
$this->normalizeIdentifier($folderIdentifier);
$files = [];
if ($folderIdentifier === self::ROOT_FOLDER_IDENTIFIER) {
- 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 deleteFolder
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function deleteFolder($folderIdentifier, $deleteRecursively = false)
{
if ($deleteRecursively) {
$items = $this->getListObjects($folderIdentifier);
foreach ($items['Contents'] ?? [] as $object) {
- 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 getObjectPermissions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getObjectPermissions($identifier)
{
$this->normalizeIdentifier($identifier);
if ($identifier === '') {
$identifier = self::ROOT_FOLDER_IDENTIFIER;
Method initializeClient
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initializeClient()
{
$configuration = [
'version' => '2006-03-01',
'region' => $this->configuration['region'] ?? '',
Function initializeClient
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function initializeClient()
{
$configuration = [
'version' => '2006-03-01',
'region' => $this->configuration['region'] ?? '',
- 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 getListObjects
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function getListObjects($identifier, $overrideArgs = [])
{
$args = [
'Bucket' => $this->configuration['bucket'] ?? '',
'Prefix' => $identifier,
- 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 getFoldersInFolder
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFoldersInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = false, array $folderNameFilterCallbacks = [], $sort = '', $sortRev = false)
{
$this->normalizeIdentifier($folderIdentifier);
$folders = [];
Method getFilesInFolder
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFilesInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = false, array $filenameFilterCallbacks = [], $sort = '', $sortRev = false)
{
$this->normalizeIdentifier($folderIdentifier);
$files = [];
if ($folderIdentifier === self::ROOT_FOLDER_IDENTIFIER) {
Method addFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addFile($localFilePath, $targetFolderIdentifier, $newFileName = '', $removeOriginal = true)
{
$newFileName = $this->sanitizeFileName($newFileName !== '' ? $newFileName : PathUtility::basename($localFilePath));
$targetIdentifier = $targetFolderIdentifier . $newFileName;
$localIdentifier = $localFilePath;
Function addFile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function addFile($localFilePath, $targetFolderIdentifier, $newFileName = '', $removeOriginal = true)
{
$newFileName = $this->sanitizeFileName($newFileName !== '' ? $newFileName : PathUtility::basename($localFilePath));
$targetIdentifier = $targetFolderIdentifier . $newFileName;
$localIdentifier = $localFilePath;
- 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 getListObjects
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getListObjects($identifier, $overrideArgs = [])
{
$args = [
'Bucket' => $this->configuration['bucket'] ?? '',
'Prefix' => $identifier,
Method upload
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload(string $localFilePath, string $targetFilePath, string $bucket, string $cacheControl)
{
$fileInfo = finfo_open(FILEINFO_MIME_TYPE);
$contentType = finfo_file($fileInfo, $localFilePath);
finfo_close($fileInfo);
Function applyFilterMethodsToDirectoryItem
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function applyFilterMethodsToDirectoryItem(array $filterMethods, $itemName, $itemIdentifier, $parentIdentifier): bool
{
foreach ($filterMethods as $filter) {
if (is_callable($filter)) {
$result = $filter($itemName, $itemIdentifier, $parentIdentifier, [], $this);
- 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 getFilesInFolder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getFilesInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = false, array $filenameFilterCallbacks = [], $sort = '', $sortRev = false)
Method getFoldersInFolder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getFoldersInFolder($folderIdentifier, $start = 0, $numberOfItems = 0, $recursive = false, array $folderNameFilterCallbacks = [], $sort = '', $sortRev = false)
Function initializeSettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function initializeSettings()
{
if (self::$settings === null) {
self::$settings = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::EXTENSION_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"