Showing 3,313 of 3,313 total issues
Function deleteSelectedVideos
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async deleteSelectedVideos () {
const toDeleteVideosIds = Object.entries(this.selection)
.filter(([ _k, v ]) => v === true)
.map(([ k, _v ]) => parseInt(k, 10))
Function askVideoPassword
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async askVideoPassword (options: { incorrectPassword: boolean, translations: Translations }): Promise<string> {
const { incorrectPassword, translations } = options
return new Promise((resolve) => {
this.wrapperElement.style.display = 'none'
Function run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async run () {
logger.info('Running PeerTube runner in server mode')
const enabledJobsArray = this.enabledJobs
? Array.from(this.enabledJobs)
Function getVideoStreamCodec
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function getVideoStreamCodec (path: string, existingProbe?: FfprobeData) {
const videoStream = await getVideoStream(path, existingProbe)
if (!videoStream) return ''
const videoCodec = videoStream.codec_tag_string
Function run
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function run () {
console.log('Moving private video files in dedicated folders.')
await ensureDir(DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE)
await ensureDir(DIRECTORIES.WEB_VIDEOS.PRIVATE)
Function buildMainQuery
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildMainQuery (options: BuildVideosListQueryOptions, serverActor: MActorAccount) {
this.attributes = {
'"video".*': ''
}
Function buildAvailableUrl
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildAvailableUrl (obj: any) {
const urls: string[] = []
if (obj.url) urls.push(obj.url)
if (obj.urls) {
Function downloadHLSVideoFile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function downloadHLSVideoFile (req: express.Request, res: express.Response) {
const video = res.locals.videoAll
const streamingPlaylist = getHLSPlaylist(video)
if (!streamingPlaylist) return res.sendStatus(HttpStatusCode.NOT_FOUND_404)
Function filter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
filter: async function (infoHash, params, cb) {
if (CONFIG.TRACKER.ENABLED === false) {
return cb(new Error('Tracker is disabled on this instance.'))
}
Function createUser
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function createUser (req: express.Request, res: express.Response) {
const body: UserCreate = req.body
const userToCreate = buildUser({
...pick(body, [ 'username', 'password', 'email', 'role', 'videoQuota', 'videoQuotaDaily', 'adminFlags' ]),
Function addVideoInPlaylist
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function addVideoInPlaylist (req: express.Request, res: express.Response) {
const body: VideoPlaylistElementCreate = req.body
const videoPlaylist = res.locals.videoPlaylistFull
const video = res.locals.onlyVideo
Function videoPlaylistsGetValidator
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const videoPlaylistsGetValidator = (fetchType: VideoPlaylistFetchType) => {
return [
isValidPlaylistIdParam('playlistId'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
Function isVideoCommentAccepted
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function isVideoCommentAccepted (req: express.Request, res: express.Response, video: MVideoFullLight, isReply: boolean) {
const acceptParameters = {
video,
commentBody: req.body,
user: res.locals.oauth.token.User,
Function processViewerStats
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async processViewerStats () {
if (this.processingViewersStats) return
this.processingViewersStats = true
if (!isTestOrDevInstance()) logger.info('Processing viewer statistics.', lTags())
Function saveToken
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function saveToken (
token: TokenInfo,
client: MOAuthClient,
user: MUser,
options: {
Function updateLocalActorImageFiles
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function updateLocalActorImageFiles (options: {
accountOrChannel: MAccountDefault | MChannelDefault
imagePhysicalFile: { path: string }
type: ActorImageType_Type
sendActorUpdate: boolean
Function buildWorker
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildWorker (handlerName: JobType) {
const workerOptions: WorkerOptions = {
autorun: false,
concurrency: this.getJobConcurrency(handlerName),
prefix: this.jobRedisPrefix,
Function onWebVideoFileTranscoding
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function onWebVideoFileTranscoding (options: {
video: MVideoFullLight
videoOutputPath: string
wasAudioFile?: boolean // default false
deleteWebInputVideoFile?: MVideoFile
Function create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create (options: CreateOptions) {
const { video, resolution, fps, dependsOnRunnerJob, separatedAudio, priority } = options
const jobUUID = buildUUID()
Function buildMetadataFromVideo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildMetadataFromVideo (video: MVideoThumbnail, type: ThumbnailType_Type, size?: ImageSize) {
const existingThumbnail = Array.isArray(video.Thumbnails)
? video.Thumbnails.find(t => t.type === type)
: undefined