Showing 14 of 14 total issues
File backupservice.php
has 431 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* ownCloud - nextbackup
*
* This file is licensed under the Affero General Public License version 3 or
BackupService
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class BackupService {
private $appName;
private $odb;
private $configService;
Method createDBBackup
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createDBBackup()
{
$timestamp = time();
try
Function createDBBackup
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function createDBBackup()
{
$timestamp = time();
try
- 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 doRestoreTable
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doRestoreTable( $timestamp, $table )
{
$timestamp = (int) $timestamp;
if ( $timestamp === 0 )
Function findIntervalTimestamps
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected static function findIntervalTimestamps( array $timestamps, $interval, $keepAmount = null )
{
if ( count( $timestamps ) === 0 ) {
return [];
}
- 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 recursivelyRemoveDir
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function recursivelyRemoveDir( $dir )
{
$success = false;
if (is_dir($dir)) {
$objects = scandir($dir);
- 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 doRestoreTable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function doRestoreTable( $timestamp, $table )
{
$timestamp = (int) $timestamp;
if ( $timestamp === 0 )
- 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 findIntervalTimestamps
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function findIntervalTimestamps( array $timestamps, $interval, $keepAmount = null )
{
if ( count( $timestamps ) === 0 ) {
return [];
}
Function updateSelectorHashItems
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateSelectorHashItems( $selectBox, items, addEmptyOption, sort )
{
if ( addEmptyOption == undefined )
{
addEmptyOption = false;
Function findIntervalTimestampsFallback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function findIntervalTimestampsFallback( array $timestamps, $interval, $keepAmount = null )
{
if ( count( $timestamps ) === 0 ) {
return [];
}
- 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 fetchTablesFromBackupTimestamp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function fetchTablesFromBackupTimestamp( $timestamp )
{
$timestamp = (int) $timestamp;
if ( $timestamp === 0 )
- 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 fetchBackupTimestamps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function fetchBackupTimestamps()
{
$backupBaseDir = $this->configService->getBackupBaseDirectory();
$timestampList = array();
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($appName, \OC_DB $odb, IDBConnection $db, ConfigService $configService, ILogger $logger, $userId){