Showing 1,292 of 3,313 total issues
Function setSort
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private setSort (sort: string) {
if (sort === '-originallyPublishedAt' || sort === 'originallyPublishedAt') {
this.attributes.push('COALESCE("video"."originallyPublishedAt", "video"."publishedAt") AS "publishedAtForOrder"')
}
Function usersCheckCurrentPasswordFactory
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const usersCheckCurrentPasswordFactory = (targetUserIdGetter: (req: express.Request) => number | string) => {
return [
body('currentPassword').optional().custom(exists),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
Function ensureCanAccessPrivateVideoHLSFiles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (areValidationErrors(req, res)) return
const videoUUID = basename(dirname(req.originalUrl))
Function buildUser
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildUser (options: {
username: string
password: string
email: string
Function buildCounters
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildCounters () {
this.errorsCounter = this.meter.createCounter('peertube_playback_errors_count', {
description: 'Errors collected from PeerTube player.'
})
Function copyOrRegenerateThumbnails
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function copyOrRegenerateThumbnails (options: {
liveVideo: MVideoThumbnail
replayVideo: MVideoWithFileThumbnail
}) {
const { liveVideo, replayVideo } = options
Function checkUserCanApproveVideoComment
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkUserCanApproveVideoComment (user: MUserAccountUrl, videoComment: MCommentOwnerVideoReply, res: express.Response) {
if (videoComment.isDeleted()) {
res.fail({
status: HttpStatusCode.CONFLICT_409,
message: 'This comment is deleted'
Function result
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const result = await VideoPathManager.Instance.makeAvailableVideoFile(inputVideoFile, async audioInputPath => {
const videoOutputPath = join(transcodeDirectory, video.id + '-transcoded' + newExtname)
// If the user updates the video preview during transcoding
const previewPath = video.getPreview().getPath()
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create (options: CreateOptions) {
const { video, resolution, fps, priority, dependsOnRunnerJob } = options
const jobUUID = buildUUID()
const payload: RunnerJobVODAudioMergeTranscodingPayload = {
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create (options: CreateOptions) {
const { video, rtmpUrl, toTranscode, playlist, segmentDuration, segmentListSize, outputDirectory, sessionId } = options
const jobUUID = buildUUID()
const payload: RunnerJobLiveRTMPHLSTranscodingPayload = {
Function extendsLocalExpiration
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async extendsLocalExpiration () {
const expired = await VideoRedundancyModel.listLocalExpired()
for (const redundancyModel of expired) {
try {
Function update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update (event?: any) {
// Playback rate menu button doesn't get a vjs-selected class
// or sets options_['selected'] on the selected playback rate.
// Thus we get the submenu value based on the labelEl of playbackRateMenuButton
if (this.subMenu.name() === 'PlaybackRateMenuButton') {
Function formValidated
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formValidated () {
this.error = undefined
const body = this.form.value
const videoChannelCreate: VideoChannelCreate = {
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor (
protected route: ActivatedRoute,
protected router: Router,
private server: ServerService,
private notifier: Notifier,
Function buildImportVideoObject
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildImportVideoObject (video: VideoUpdate): VideoImportCreate {
const language = video.language || null
const licence = video.licence || null
const category = video.category || null
const description = video.description || null
Function buildCommonVideosParams
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildCommonVideosParams (options: CommonVideoParams & { params: HttpParams }) {
const {
params,
videoPagination,
sort,
Function updateDetails
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateDetails (onlyKeys?: string[]) {
const nsfwPolicy = this.form.value['nsfwPolicy']
const p2pEnabled = this.form.value['p2pEnabled']
const autoPlayVideo = this.form.value['autoPlayVideo']
const autoPlayNextVideo = this.form.value['autoPlayNextVideo']
Function getPlayerConstructorOptions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getPlayerConstructorOptions (options: {
serverConfig: HTMLServerConfig
authorizationHeader: () => string
}): PeerTubePlayerContructorOptions {
const { serverConfig, authorizationHeader } = options
Function refreshAccessToken
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
refreshAccessToken () {
if (this.refreshingTokenObservable) return this.refreshingTokenObservable
if (!this.getAccessToken()) return throwError(() => new Error($localize`You need to reconnect`))
logger.info('Refreshing token...')
Function computeTypeahead
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
computeTypeahead () {
const searchIndexConfig = this.serverConfig.search.searchIndex
if (!this.activeSearch) {
if (searchIndexConfig.enabled && (searchIndexConfig.isDefaultSearch || searchIndexConfig.disableLocalSearch)) {