Showing 4,504 of 4,504 total issues
Function syncSingleUser
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function syncSingleUser(
InputInterface $input,
OutputInterface $output,
SyncService $syncService,
UserInterface $backend,
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
'@phan-var \OC\Files\MimetypeDetector $this->mimetypeDetector';
$mappings = $this->mimetypeDetector->getAllMappings();
$totalFilecacheUpdates = 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 handleRemovedUsers
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function handleRemovedUsers(array $removedUsers, InputInterface $input, OutputInterface $output, $missingAccountsAction): void {
if (empty($removedUsers)) {
$output->writeln('No removed users have been detected.');
} else {
// define some actions to be used
- 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 render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var parts = this._makeCrumbs(this.dir || '/');
var $crumb;
this.$el.empty();
this.breadcrumbs = [];
Function setSort
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
setSort: function(sort, direction, update, persist) {
var comparator = FileList.Comparators[sort] || FileList.Comparators.name;
this._sort = sort;
this._sortDirection = (direction === 'desc')?'desc':'asc';
this._sortComparator = comparator;
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
if (this.model) {
var isFavorite = (this.model.get('tags') || []).indexOf(OC.TAG_FAVORITE) >= 0;
this.$el.html(this.template({
type: this.model.isImage()? 'image': '',
Function updateSelectionSummary
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateSelectionSummary: function() {
var summary = this._selectionSummary.summary;
var selection;
var showHidden = !!this._filesConfig.get('showhidden');
Function _onProgress
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onProgress: function (e, data) {
if (e.lengthComputable) {
var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
loaded;
if (data._time && data.progressInterval &&
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var baseTemplate = this._getTemplate('base', TEMPLATE_BASE);
this.$el.html(baseTemplate({
cid: this.cid,
Function putFileContents
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
putFileContents: function(path, body, options) {
if (!path) {
throw 'Missing argument "path"';
}
var self = this;
Function getShareeObject
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getShareeObject: function(shareIndex) {
var shareWith = this.model.getShareWith(shareIndex);
var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex);
var shareType = this.model.getShareType(shareIndex);
var shareWithAdditionalInfo = this.model.getShareWithAdditionalInfo(shareIndex);
Function getShareeList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getShareeList: function() {
var universal = {
avatarEnabled: this.configModel.areAvatarsEnabled(),
mailNotificationEnabled: this.configModel.isMailNotificationEnabled(),
notifyByMailLabel: t('core', 'notify by email'),
Method isUsedTlsLibOutdated
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function isUsedTlsLibOutdated(): string {
// Don't run check when:
// 1. Server has `has_internet_connection` set to false
// 2. App Store AND S2S is disabled
if (!$this->config->getSystemValue('has_internet_connection', true)) {
Method handleException
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleException($e) {
$request = \OC::$server->getRequest();
// in case the request content type is text/xml - we assume it's a WebDAV request
$isXmlContentType = \strpos($request->getHeader('Content-Type') ?? '', 'text/xml');
if ($isXmlContentType === 0) {
Method doDelete
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doDelete($path, $method) {
if (self::$disableTrash
|| !\OC_App::isEnabled('files_trashbin')
|| (\pathinfo($path, PATHINFO_EXTENSION) === 'part')
|| $this->shouldMoveToTrash($path) === false
Method registerService
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function registerService() {
$container = $this->getContainer();
$container->registerService('addServerMiddleware', function (IAppContainer $c) {
return new AddServerMiddleware(
Method getCalendarByUri
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCalendarByUri($principal, $uri) {
$fields = \array_values($this->propertyMap);
$fields[] = 'id';
$fields[] = 'uri';
$fields[] = 'synctoken';
Method createCardsTable
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createCardsTable(Schema $schema) {
if (!$schema->hasTable("{$this->prefix}cards")) {
$table = $schema->createTable("{$this->prefix}cards");
$table->addColumn('id', 'integer', [
'autoincrement' => true,
Method displayPanel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function displayPanel() {
$lastUpdateCheck = $this->dateTimeFormatter->formatDateTime(
$this->config->getAppValue('core', 'lastupdatedat')
);
Method httpGet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function httpGet(RequestInterface $request, ResponseInterface $response) {
// Only handle valid files
$node = $this->tree->getNodeForPath($request->getPath());
if (!($node instanceof IFile)) {
return;