Showing 1,292 of 3,313 total issues
Function getMetadataStream
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private getMetadataStream (streams: any[], type: 'video' | 'audio') {
const stream = streams.find(s => s.codec_type === type)
if (!stream) return undefined
let keyToTranslateFunction = {
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor (hash: ServerVideoPlaylist, translations: { [ id: string ]: string }) {
const absoluteAPIUrl = getAbsoluteAPIUrl()
this.id = hash.id
this.uuid = hash.uuid
Function viewReplies
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
viewReplies (commentId: number, highlightThread = false) {
this.threadLoading[commentId] = true
const params = {
videoId: this.video.uuid,
Function getStateLabel
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getStateLabel (video: Video) {
if (!video.state) return ''
if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) {
return $localize`Published`
Function loadPlaylistElements
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadPlaylistElements (playlist: VideoPlaylist, redirectToFirst = false, position?: number) {
const obs = this.hooks.wrapObsFun(
this.videoPlaylist.getPlaylistVideos.bind(this.videoPlaylist),
{ videoPlaylistId: playlist.uuid, componentPagination: this.playlistPagination },
'video-watch',
Function containerBuilder
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private containerBuilder (el: HTMLElement) {
const data = el.dataset as ContainerMarkupData
// Move inner HTML in the new element we'll create
const content = el.innerHTML
Function next
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
next: async resultList => {
this.totalRecords = resultList.total
this.abuses = []
Function defineGetAccessProgram
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function defineGetAccessProgram () {
const program = new Command()
.name('get-access-token')
.description('Get a peertube access token')
.alias('token')
Function up
has 28 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 sendCachedResponse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private sendCachedResponse (request: express.Request, response: express.Response, cacheObject: CacheObject, duration: number) {
const headers = response.getHeaders()
if (isTestInstance()) {
Object.assign(headers, {
Function plainTextPlugin
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function plainTextPlugin (markdownIt: any) {
function plainTextRule (state: any) {
const text = scan(state.tokens)
markdownIt.plainText = text
Function createUserAccountAndChannelAndPlaylist
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function createUserAccountAndChannelAndPlaylist (parameters: {
userToCreate: MUser
userDisplayName?: string
channelNames?: ChannelNames
validateUser?: boolean
Function insertFromImportIntoDB
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function insertFromImportIntoDB (parameters: {
video: MVideoThumbnail
thumbnailModel: MThumbnail
previewModel: MThumbnail
videoChannel: MChannelAccountDefault
Function onTranscriptionEnded
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function onTranscriptionEnded (options: {
video: MVideoFullLight
language: string
vttPath: string
lTags?: (string | number)[]
Function checkVideoFileCanBeEdited
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function checkVideoFileCanBeEdited (video: MVideo, res: express.Response) {
if (video.isLive) {
res.fail({
status: HttpStatusCode.BAD_REQUEST_400,
message: 'Cannot edit a live video'
Function checkVideoCanBeTranscribedOrTranscripted
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function checkVideoCanBeTranscribedOrTranscripted (video: MVideo, res: express.Response) {
if (video.remote) {
res.fail({
status: HttpStatusCode.BAD_REQUEST_400,
message: 'Cannot run this task on a remote video'
Function importObject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected async importObject (channelImportData: SanitizedObject) {
const account = this.user.Account
const existingChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(channelImportData.name)
if (existingChannel) {
Function saveNewOriginalFileIfNeeded
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function saveNewOriginalFileIfNeeded (video: MVideo, videoFile: MVideoFile) {
if (!CONFIG.TRANSCODING.ORIGINAL_FILE.KEEP) return
const videoSource = await VideoSourceModel.loadLatest(video.id)
Function crawlCollectionPage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function crawlCollectionPage <T> (argUrl: string, handler: HandlerFunction<T>, cleaner?: CleanerFunction) {
let url = argUrl
logger.info('Crawling ActivityPub data on %s.', url)
Function registerSourceHandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const registerSourceHandler = function (vjs: typeof videojs) {
if (!Hlsjs.isSupported()) {
logger.info('Hls.js is not supported in this browser.')
return
}