Showing 1,292 of 3,313 total issues
Function onVideoStudioEnded
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function onVideoStudioEnded (options: {
editionResultPath: string
tasks: VideoStudioTaskPayload[]
video: MVideoFullLight
}) {
Function processFollow
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function processFollow (byActor: MActorSignature, activityId: string, targetActorURL: string) {
const { actorFollow, created, targetActor } = await sequelizeTypescript.transaction(async t => {
const targetActor = await ActorModel.loadByUrlAndPopulateAccountAndChannel(targetActorURL, t)
if (!targetActor) throw new Error('Unknown actor')
Function buildTasks
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private buildTasks () {
const tasks: VideoStudioTask[] = []
const value = this.form.value
const cut = value['cut']
Function buildMenu
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private buildMenu () {
this.menuEntries = [
{
label: $localize`Channels`,
routerLink: '/my-library/video-channels'
Function addWatermark
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
async addWatermark (options: BaseStudioOptions & {
watermarkPath: string
videoFilters: {
watermarkSizeRatio: number
Function buildVideoAttributesFromCommander
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function buildVideoAttributesFromCommander (server: PeerTubeServer, options: UploadOptions) {
const defaultBooleanAttributes = {
nsfw: false,
downloadEnabled: true,
waitTranscoding: true
Function onData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
readable.on('data', async function onData (chunk) {
try {
readable.pause()
const byterangeStart = start + chunk.length - 1
Function generateVideoPodcastFeed
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function generateVideoPodcastFeed (req: express.Request, res: express.Response) {
const videoChannel = res.locals.videoChannel
const { name, userName, description, imageUrl, accountImageUrl, email, link, accountLink } = await buildFeedMetadata({ videoChannel })
Function onAfterMuxingCleanup
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async onAfterMuxingCleanup (options: {
videoUUID: string
liveSession?: MVideoLiveSession
cleanupNow?: boolean // Default false
}) {
Function getRedisClientOptions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getRedisClientOptions (name?: string, options: RedisOptions = {}, logOptions = false): RedisOptions {
const connectionName = [ 'PeerTube', name ].join('')
const connectTimeout = 20000 // Could be slow since node use sync call to compile PeerTube
if (CONFIG.REDIS.SENTINEL.ENABLED) {
Function userRateVideo
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function userRateVideo (options: {
rateType: UserVideoRateType
account: MAccountUrl & MAccountId
video: MVideoFullLight
}) {
Function updateVideoFile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateVideoFile (options: {
videoFile: VideoFile
isUserResolutionChange: boolean
}) {
this.currentVideoFile = options.videoFile
Function loadMoreVideoChannels
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private loadMoreVideoChannels () {
if (this.pagesDone.has(this.pagination.currentPage)) return
this.pagesDone.add(this.pagination.currentPage)
return this.authService.userInformationLoaded
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (
private authHttp: HttpClient,
private restExtractor: RestExtractor
) {
this.videoQuotaOptions = [
Function updatePluginFields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async updatePluginFields () {
this.pluginFields = this.pluginService.getRegisteredVideoFormFields(this.type)
if (this.pluginFields.length === 0) return
Function parseQueryStringFilter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseQueryStringFilter <T extends QueryStringFilterPrefixes> (q: string, prefixes: T): ParseQueryStringFiltersResult<keyof T> {
if (!q) return {}
const tokens = this.tokenizeString(q)
Function buildAdditionalAttributes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function buildAdditionalAttributes (video: MVideoFormattable, options: VideoFormattingJSONOptions) {
const add = options.additionalAttributes
const result: Partial<VideoAdditionalAttributes> = {}
- 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 checkMissedConfig
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function checkMissedConfig () {
const required = [ 'listen.port', 'listen.hostname',
'webserver.https', 'webserver.hostname', 'webserver.port',
'secrets.peertube',
'trust_proxy',
- 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 generateOutput
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async function generateOutput (options: {
startDateQuery: string
endDateQuery?: string
level: ServerLogLevel
- 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 buildFeedMetadata
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export async function buildFeedMetadata (options: {
videoChannel?: MChannelBannerAccountDefault
account?: MAccountDefault
video?: MVideoFullLight
}) {
- 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"