Showing 1,292 of 3,313 total issues
Function prune
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async prune () {
const dirs = Object.values(CONFIG.STORAGE)
if (uniqify(dirs).length !== dirs.length) {
console.error('Cannot prune storage because you put multiple storage keys in the same directory.')
Function videoFilesModelToFormattedJSON
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function videoFilesModelToFormattedJSON (
video: MVideoFormattable,
videoFiles: MVideoFileRedundanciesOpt[],
options: {
includeMagnet?: boolean // default true
Function buildVideoMimetypeExt
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildVideoMimetypeExt () {
const data = {
// streamable formats that warrant cross-browser compatibility
'video/webm': '.webm',
// We'll add .ogg if additional extensions are enabled
Function getOutputFromFile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getOutputFromFile (options: {
path: string
startDate: Date
endDate: Date
level: ServerLogLevel
Function watchTSFiles
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private watchTSFiles () {
const startStreamDateTime = new Date().getTime()
const addHandler = async (segmentPath: string) => {
if (segmentPath.endsWith('.ts') !== true) return
Function videoStudioAddEditionValidator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (CONFIG.VIDEO_STUDIO.ENABLED !== true) {
res.fail({
status: HttpStatusCode.BAD_REQUEST_400,
message: 'Video studio is disabled on this instance'
Function buildTranscodingManager
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildTranscodingManager () {
const self = this
function addProfile (type: 'live' | 'vod', encoder: string, profile: string, builder: EncoderOptionsBuilder) {
if (profile === 'default') {
Function processVideoLiveEnding
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function processVideoLiveEnding (job: Job) {
const payload = job.data as VideoLiveEndingPayload
logger.info('Processing video live ending for %s.', payload.videoId, { payload, ...lTags() })
Function processDeleteActivity
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function processDeleteActivity (options: APProcessorOptions<ActivityDelete>) {
const { activity, byActor } = options
const objectUrl = typeof activity.object === 'string' ? activity.object : activity.object.id
Function initTouchStartEvents
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private initTouchStartEvents () {
const handleTouchStart = (event: TouchEvent, onlyDetectDoubleTap = false) => {
debugLogger('Handle touch start')
if (this.tapTimeout) {
Function onContextMenu
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private onContextMenu (e: TouchEvent & MouseEvent) {
// If this event happens while the custom menu is open, close it and do
// nothing else. This will cause native contextmenu events to be intercepted
// once again; so, the next time a contextmenu event is encountered, we'll
// open the custom menu.
Function importVideo
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
importVideo () {
this.isImportingVideo = true
const videoUpdate: VideoUpdate = {
privacy: this.highestPrivacy,
Function buildInternalActions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildInternalActions (): DropdownAction<ProcessedAbuse>[] {
return [
{
label: $localize`Internal actions`,
isHeader: true
Function show
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) {
let subtitle: string
if (this.videoCaptions && this.videoCaptions.length !== 0) {
subtitle = this.videoCaptions[0].language.id
}
Function setupStateTracking
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private setupStateTracking () {
let currentState: 'playing' | 'paused' | 'unstarted' | 'ended' = 'unstarted'
this.videoElInterval = setInterval(() => {
const position = this.player?.currentTime() ?? 0
Function deleteRemoteFiles
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function deleteRemoteFiles () {
console.log('Detecting remote files that can be deleted...')
const thumbnails = await ThumbnailModel.listRemoteOnDisk()
const actorImages = await ActorImageModel.listRemoteOnDisk()
Function run
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function run () {
await initDatabaseModels(true)
{
console.log('## Updating "formatFlags" column for web videos in "videoFile" table in database ##\n')
Function listForApi
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static listForApi (options: {
start: number
count: number
videoPlaylistId: number
serverAccount: AccountModel
Function listHandlesBlockedBy
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static listHandlesBlockedBy (accountIds: number[]): Promise<string[]> {
const query = {
attributes: [ 'id' ],
where: {
accountId: {
Function generateSchemaTagsOptions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static generateSchemaTagsOptions (tags: Tags, context: HookContext) {
if (!tags.schemaType) return
if (tags.schemaType === 'ProfilePage') {
if (!tags.jsonldProfile) throw new Error('Missing `jsonldProfile` with ProfilePage schema type')