Showing 1,292 of 3,313 total issues
File video-api-format.ts
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { getResolutionLabel } from '@peertube/peertube-core-utils'
import {
Video,
VideoAdditionalAttributes,
VideoCommentPolicy,
File video-share.component.ts
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { NgClass, NgFor, NgIf } from '@angular/common'
import { Component, ElementRef, Input, ViewChild } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
import { RouterLink } from '@angular/router'
SubscribeButtonComponent
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'my-subscribe-button',
templateUrl: './subscribe-button.component.html',
styleUrls: [ './subscribe-button.component.scss' ],
standalone: true,
Video
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
export class Video implements VideoServerModel {
byVideoChannel: string
byAccount: string
createdAt: Date
UserModerationDropdownComponent
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'my-user-moderation-dropdown',
templateUrl: './user-moderation-dropdown.component.html',
standalone: true,
imports: [ NgIf, UserBanModalComponent, ActionDropdownComponent ]
ObjectStorageCommand
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
export class ObjectStorageCommand {
static readonly DEFAULT_SCALEWAY_BUCKET = 'peertube-ci-test'
private readonly bucketsCreated: string[] = []
private readonly seed: number
File me.ts
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { pick } from '@peertube/peertube-core-utils'
import {
ActorImageType,
UserVideoRate as FormattedUserVideoRate,
HttpStatusCode,
File register-helpers.ts
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import express from 'express'
import { Server } from 'http'
import {
EncoderOptionsBuilder,
PluginSettingsManager,
Function saveReplayToExternalVideo
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function saveReplayToExternalVideo (options: {
liveVideo: MVideoThumbnail
liveSession: MVideoLiveSession
publishedAt: string
replayDirectory: string
Function sendCreateVideoCommentIfNeeded
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function sendCreateVideoCommentIfNeeded (comment: MCommentOwnerVideoReply, transaction: Transaction) {
const isOrigin = comment.Video.isOwned()
if (isOrigin) {
const videoWithBlacklist = await VideoModel.loadWithBlacklist(comment.Video.id)
Function buildAdminInputFilter
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildAdminInputFilter (): AdvancedInputFilter[] {
return [
{
title: $localize`Video type`,
children: [
File video-caption-edit-modal-content.component.ts
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { NgClass, NgForOf, NgIf } from '@angular/common'
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { VIDEO_CAPTION_FILE_CONTENT_VALIDATOR } from '@app/shared/form-validators/video-captions-validators'
import { FormReactive } from '@app/shared/shared-forms/form-reactive'
Function processCreateAbuse
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function processCreateAbuse (flag: ActivityFlag, byActor: MActorSignature) {
const account = byActor.Account
if (!account) throw new Error('Cannot create abuse with the non account actor ' + byActor.url)
const reporterAccount = await AccountModel.load(account.id)
Function run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
async function run () {
await initDatabaseModels(true)
JobQueue.Instance.init()
- 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 oembedValidator
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (areValidationErrors(req, res)) return
if (req.query.format !== undefined && req.query.format !== 'json') {
return res.fail({
- 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 updateVideoViewersCount
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private async updateVideoViewersCount () {
if (this.processingViewerCounters) return
this.processingViewerCounters = true
if (!isTestOrDevInstance()) {
- 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 watchTSFiles
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private watchTSFiles () {
const startStreamDateTime = new Date().getTime()
const addHandler = async (segmentPath: string) => {
if (segmentPath.endsWith('.ts') !== true) 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 update
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
update (event?: any) {
// Playback rate menu button doesn't get a vjs-selected class
// or sets options_['selected'] on the selected playback rate.
// Thus we get the submenu value based on the labelEl of playbackRateMenuButton
if (this.subMenu.name() === 'PlaybackRateMenuButton') {
- 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 constructor
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
constructor (hash: UserNotificationServer, user: AuthUser) {
this.id = hash.id
this.type = hash.type
this.read = hash.read
- 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 decorateVideoLink
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function decorateVideoLink (options: {
url: string
startTime?: number
stopTime?: number
- 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"