Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

Function deleteSelectedVideos has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async deleteSelectedVideos () {
    const toDeleteVideosIds = Object.entries(this.selection)
                                    .filter(([ _k, v ]) => v === true)
                                    .map(([ k, _v ]) => parseInt(k, 10))

Severity: Minor
Found in client/src/app/+my-library/my-videos/my-videos.component.ts - About 1 hr to fix

    Function askVideoPassword has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async askVideoPassword (options: { incorrectPassword: boolean, translations: Translations }): Promise<string> {
        const { incorrectPassword, translations } = options
        return new Promise((resolve) => {
    
          this.wrapperElement.style.display = 'none'
    Severity: Minor
    Found in client/src/standalone/videos/shared/player-html.ts - About 1 hr to fix

      Function run has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async run () {
          logger.info('Running PeerTube runner in server mode')
      
          const enabledJobsArray = this.enabledJobs
            ? Array.from(this.enabledJobs)
      Severity: Minor
      Found in apps/peertube-runner/src/server/server.ts - About 1 hr to fix

        Function getVideoStreamCodec has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export async function getVideoStreamCodec (path: string, existingProbe?: FfprobeData) {
          const videoStream = await getVideoStream(path, existingProbe)
          if (!videoStream) return ''
        
          const videoCodec = videoStream.codec_tag_string
        Severity: Minor
        Found in server/core/helpers/ffmpeg/codecs.ts - About 1 hr to fix

          Function run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          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)
          Severity: Minor
          Found in server/scripts/migrations/peertube-5.0.ts - About 1 hr to fix

            Function buildMainQuery has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              private buildMainQuery (options: BuildVideosListQueryOptions, serverActor: MActorAccount) {
                this.attributes = {
                  '"video".*': ''
                }
            
            

              Function buildAvailableUrl has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private buildAvailableUrl (obj: any) {
                  const urls: string[] = []
              
                  if (obj.url) urls.push(obj.url)
                  if (obj.urls) {
              Severity: Minor
              Found in server/core/helpers/youtube-dl/youtube-dl-info-builder.ts - About 1 hr to fix

                Function downloadHLSVideoFile has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                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)
                
                
                Severity: Minor
                Found in server/core/controllers/download.ts - About 1 hr to fix

                  Function filter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    filter: async function (infoHash, params, cb) {
                      if (CONFIG.TRACKER.ENABLED === false) {
                        return cb(new Error('Tracker is disabled on this instance.'))
                      }
                  
                  
                  Severity: Minor
                  Found in server/core/controllers/tracker.ts - About 1 hr to fix

                    Function createUser has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    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' ]),
                    Severity: Minor
                    Found in server/core/controllers/api/users/index.ts - About 1 hr to fix

                      Function addVideoInPlaylist has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      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
                      
                      
                      Severity: Minor
                      Found in server/core/controllers/api/video-playlist.ts - About 1 hr to fix

                        Function videoPlaylistsGetValidator has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const videoPlaylistsGetValidator = (fetchType: VideoPlaylistFetchType) => {
                          return [
                            isValidPlaylistIdParam('playlistId'),
                        
                            async (req: express.Request, res: express.Response, next: express.NextFunction) => {
                        Severity: Minor
                        Found in server/core/middlewares/validators/videos/video-playlists.ts - About 1 hr to fix

                          Function isVideoCommentAccepted has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          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,
                          Severity: Minor
                          Found in server/core/middlewares/validators/videos/video-comments.ts - About 1 hr to fix

                            Function processViewerStats has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              async processViewerStats () {
                                if (this.processingViewersStats) return
                                this.processingViewersStats = true
                            
                                if (!isTestOrDevInstance()) logger.info('Processing viewer statistics.', lTags())
                            Severity: Minor
                            Found in server/core/lib/views/shared/video-viewer-stats.ts - About 1 hr to fix

                              Function saveToken has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              async function saveToken (
                                token: TokenInfo,
                                client: MOAuthClient,
                                user: MUser,
                                options: {
                              Severity: Minor
                              Found in server/core/lib/auth/oauth-model.ts - About 1 hr to fix

                                Function updateLocalActorImageFiles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export async function updateLocalActorImageFiles (options: {
                                  accountOrChannel: MAccountDefault | MChannelDefault
                                  imagePhysicalFile: { path: string }
                                  type: ActorImageType_Type
                                  sendActorUpdate: boolean
                                Severity: Minor
                                Found in server/core/lib/local-actor.ts - About 1 hr to fix

                                  Function buildWorker has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private buildWorker (handlerName: JobType) {
                                      const workerOptions: WorkerOptions = {
                                        autorun: false,
                                        concurrency: this.getJobConcurrency(handlerName),
                                        prefix: this.jobRedisPrefix,
                                  Severity: Minor
                                  Found in server/core/lib/job-queue/job-queue.ts - About 1 hr to fix

                                    Function onWebVideoFileTranscoding has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export async function onWebVideoFileTranscoding (options: {
                                      video: MVideoFullLight
                                      videoOutputPath: string
                                      wasAudioFile?: boolean // default false
                                      deleteWebInputVideoFile?: MVideoFile
                                    Severity: Minor
                                    Found in server/core/lib/transcoding/web-transcoding.ts - About 1 hr to fix

                                      Function create has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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

                                        function buildMetadataFromVideo (video: MVideoThumbnail, type: ThumbnailType_Type, size?: ImageSize) {
                                          const existingThumbnail = Array.isArray(video.Thumbnails)
                                            ? video.Thumbnails.find(t => t.type === type)
                                            : undefined
                                        
                                        
                                        Severity: Minor
                                        Found in server/core/lib/thumbnail.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language