Showing 1,292 of 3,313 total issues
Function broadcastTo
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function broadcastTo (options: {
uris: string[]
data: any
byActor: MActorId
contextType: ContextType
Function initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private initialize () {
this.liveEnded = false
this.buildBaseConfig()
Function buildHotkeysHelp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildHotkeysHelp (video: Video) {
if (this.hotkeys.length !== 0) {
this.hotkeysService.remove(this.hotkeys)
}
Function updateVideosOverview
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private updateVideosOverview (serverVideosOverview: VideosOverviewServer): Observable<VideosOverview> {
const observables: Observable<any>[] = []
const videosOverviewResult: VideosOverview = {
tags: [],
categories: [],
Function waitUntilSegmentGeneration
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async waitUntilSegmentGeneration (options: OverrideCommandOptions & {
server: PeerTubeServer
videoUUID: string
playlistNumber: number
segment: number
Function downloadFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function downloadFile (options: {
url: string
destination: string
runnerToken: string
jobToken: string
Function up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up (utils: {
transaction: Sequelize.Transaction
queryInterface: Sequelize.QueryInterface
sequelize: Sequelize.Sequelize
db: any
Function acceptRunnerJob
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function acceptRunnerJob (req: express.Request, res: express.Response) {
const runner = res.locals.runner
const runnerJob = res.locals.runnerJob
const newRunnerJob = await retryTransactionWrapper(() => {
Function handleToken
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function handleToken (req: express.Request, res: express.Response, next: express.NextFunction) {
const grantType = req.body.grant_type
try {
const bypassLogin = await buildByPassLogin(req, grantType)
Function reorderVideosPlaylist
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function reorderVideosPlaylist (req: express.Request, res: express.Response) {
const videoPlaylist = res.locals.videoPlaylistFull
const body: VideoPlaylistReorder = req.body
const start: number = body.startPosition
Function updateObjectIfNeeded
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function updateObjectIfNeeded <T> (options: {
url: string
bodyValidator: (body: any) => boolean
updater: (url: string, newUrl: string) => Promise<T>
deleter: (url: string) => Promise<T> }
Function processVideosViewsStats
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function processVideosViewsStats () {
const lastHour = new Date()
// In test mode, we run this function multiple times per hour, so we don't want the values of the previous hour
if (!isTestOrDevInstance()) lastHour.setHours(lastHour.getHours() - 1)
Function buildNewFile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function buildNewFile (options: {
path: string
mode: 'web-video' | 'hls'
ffprobe?: FfprobeData
}): Promise<MVideoFile> {
Function createElements
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async createElements (playlist: MVideoPlaylistThumbnail, playlistImportData: SanitizedObject) {
const elementsToCreate: { videoId: number, startTimestamp: number, stopTimestamp: number }[] = []
for (const element of playlistImportData.elements.slice(0, USER_IMPORT.MAX_PLAYLIST_ELEMENTS)) {
const video = await loadOrCreateVideoIfAllowedForUser(element.videoUrl)
Function updateSha256VODSegments
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function updateSha256VODSegments (video: MVideo, playlistArg: MStreamingPlaylist): Promise<MStreamingPlaylistFilesVideo> {
return playlistFilesQueue.add(async () => {
const json: { [filename: string]: { [range: string]: string } } = {}
const playlist = await VideoStreamingPlaylistModel.loadWithVideoAndFiles(playlistArg.id)
Function validate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async validate (segment: Segment, _method: string, _peerId: string, retry = 1) {
if (this.destroyed) return
this.loadSha256SegmentsPromiseIfNeeded()
Function create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create () {
logger.debug('Adding remote video %s.', this.videoObject.id, this.lTags())
const channelActor = await this.getOrCreateVideoChannelFromVideoObject()
const channel = channelActor.VideoChannel
Function _notifyVideoQualities
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private _notifyVideoQualities () {
if (!this.metadata) return
const resolutions: PeerTubeResolution[] = []
Function signup
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async signup () {
this.signupError = undefined
const termsForm = this.formStepTerms.value
const userForm = this.formStepUser.value
Function buildTitle
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildTitle (scope: VideoFilterScope = this.defaultScope, sort: VideoSortField = this.defaultSort) {
const sanitizedSort = this.getSanitizedSort(sort)
if (scope === 'local') {
this.title = $localize`Local videos`