Showing 1,292 of 3,313 total issues
UsersCommand
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export class UsersCommand extends AbstractCommand {
askResetPassword (options: OverrideCommandOptions & {
email: string
}) {
Function up
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function up (utils: {
transaction: Sequelize.Transaction
queryInterface: Sequelize.QueryInterface
sequelize: Sequelize.Sequelize
}): Promise<void> {
Function updateVideoPlaylist
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function updateVideoPlaylist (req: express.Request, res: express.Response) {
const videoPlaylistInstance = res.locals.videoPlaylistFull
const videoPlaylistInfoToUpdate = req.body as VideoPlaylistUpdate
const wasPrivatePlaylist = videoPlaylistInstance.privacy === VideoPlaylistPrivacy.PRIVATE
Function buildRegisterHelpers
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildRegisterHelpers (): RegisterServerOptions {
const registerHook = this.buildRegisterHook()
const registerSetting = this.buildRegisterSetting()
const getRouter = this.buildGetRouter()
Function getPlayerLoadOptions
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getPlayerLoadOptions (options: {
video: VideoDetails
captionsResponse: Response
storyboardsResponse: Response
Function assignCommands
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private assignCommands () {
this.bulk = new BulkCommand(this)
this.cli = new CLICommand(this)
this.customPage = new CustomPagesCommand(this)
this.feed = new FeedCommand(this)
File videos-importer.ts
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { pick } from '@peertube/peertube-core-utils'
import { ffprobePromise, getVideoStreamDuration } from '@peertube/peertube-ffmpeg'
import {
LiveVideoLatencyMode,
ThumbnailType,
File plugin.service.ts
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { firstValueFrom, Observable, of } from 'rxjs'
import { catchError, map, shareReplay } from 'rxjs/operators'
import { HttpClient } from '@angular/common/http'
import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core'
import { VideoEditType } from '@app/+videos/+video-edit/shared/video-edit.type'
Function ScopeNames.SUMMARY
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
[ScopeNames.SUMMARY]: (options: SummaryOptions = {}) => {
const serverInclude: IncludeOptions = {
attributes: [ 'host' ],
model: ServerModel.unscoped(),
required: !!options.whereServer,
Function constructor
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (
protected route: ActivatedRoute,
protected router: Router,
private notifier: Notifier,
private serverService: ServerService,
Function hijackMouseTooltip
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private hijackMouseTooltip (evt: Event) {
const sprite = this.sprites[this.url]
const imgWidth = sprite.naturalWidth
const imgHeight = sprite.naturalHeight
const seekBarEl = this.seekBar.el()
Function loadVideo
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private loadVideo (options: {
videoId: string
forceAutoplay: boolean
liveRefresh?: boolean
videoPassword?: string
Function loadPlayer
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async loadPlayer (options: {
loggedInOrAnonymousUser: User
forceAutoplay: boolean
}) {
const { loggedInOrAnonymousUser, forceAutoplay } = options
File video-comments.component.ts
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { NgFor, NgIf } from '@angular/common'
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
import { AuthService, ComponentPagination, ConfirmService, Notifier, User, hasMoreItems } from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
Function processStudioTranscoding
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function processStudioTranscoding (options: ProcessOptions<RunnerJobStudioTranscodingPayload>) {
const { server, job, runnerToken } = options
const payload = job.payload
let videoInputPath: string
Function processVideo
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async function processVideo (videoId: number) {
const video = await VideoModel.loadWithFiles(videoId)
if (video.isLive) return
const files = await Promise.all(video.getAllFiles().map(f => VideoFileModel.loadWithMetadata(f.id)))
- 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 processActivityPubFollow
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async function processActivityPubFollow (job: Job) {
const payload = job.data as ActivitypubFollowPayload
const host = payload.host
const handle = host
- 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 buildHandlers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private buildHandlers () {
const handlers: KeyHandler[] = [
// Play
{
accept: e => (e.key === ' ' || e.key === 'MediaPlayPause'),
- 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 onStatusChanged
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private onStatusChanged (options: {
form: FormGroup
formErrors: FormReactiveErrors
validationMessages: FormReactiveValidationMessages
onlyDirty?: boolean // default true
- 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 checkAvailableJobs
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private async checkAvailableJobs () {
if (!this.initialized) return
if (this.checkingAvailableJobs) return
this.checkingAvailableJobs = true
- 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"