Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function downloadWebTorrentVideo has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function downloadWebTorrentVideo (target: { uri: string, torrentName?: string }, timeout: number) {
  const id = target.uri || target.torrentName
  let timer

  const path = generateVideoImportTmpPath(id)
Severity: Major
Found in server/core/helpers/webtorrent.ts - About 2 hrs to fix

    Function videoLiveAddValidator has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async (req: express.Request, res: express.Response, next: express.NextFunction) => {
        if (areValidationErrors(req, res)) return cleanUpReqFiles(req)
    
        if (!isValidPasswordProtectedPrivacy(req, res)) return cleanUpReqFiles(req)
    
    
    Severity: Major
    Found in server/core/middlewares/validators/videos/video-live.ts - About 2 hrs to fix

      Function updateMasterHLSPlaylist has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function updateMasterHLSPlaylist (video: MVideo, playlistArg: MStreamingPlaylist): Promise<MStreamingPlaylistFilesVideo> {
        return playlistFilesQueue.add(async () => {
          const playlist = await VideoStreamingPlaylistModel.loadWithVideoAndFiles(playlistArg.id)
      
          const extMedia: string[] = []
      Severity: Major
      Found in server/core/lib/hls.ts - About 2 hrs to fix

        Function update has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async update (overrideTo?: string[]) {
            logger.debug(
              'Updating remote video "%s".', this.videoObject.uuid,
              { videoObject: this.videoObject, ...this.lTags() }
            )
        Severity: Major
        Found in server/core/lib/activitypub/videos/updater.ts - About 2 hrs to fix

          Function processVideoTranscription has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function processVideoTranscription (options: ProcessOptions<RunnerJobTranscriptionPayload>) {
            const { server, job, runnerToken } = options
          
            const config = ConfigManager.Instance.getConfig().transcription
          
          

            Function processHLSTranscoding has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function processHLSTranscoding (options: ProcessOptions<RunnerJobVODHLSTranscodingPayload>) {
              const { server, job, runnerToken } = options
              const payload = job.payload
            
              let ffmpegProgress: number
            Severity: Major
            Found in apps/peertube-runner/src/server/process/shared/process-vod.ts - About 2 hrs to fix

              Function getSitemapLocalVideoUrls has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function getSitemapLocalVideoUrls () {
                const serverActor = await getServerActor()
              
                let acc: { url: string, video: any[] }[] = []
              
              
              Severity: Major
              Found in server/core/controllers/sitemap.ts - About 2 hrs to fix

                Function addVideo has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function addVideo (options: {
                  req: express.Request
                  res: express.Response
                  videoPhysicalFile: express.VideoLegacyUploadFile
                  videoInfo: VideoCreate
                Severity: Major
                Found in server/core/controllers/api/videos/upload.ts - About 2 hrs to fix

                  Function addVideosToFeed has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function addVideosToFeed (feed: Feed, videos: VideoModel[]) {
                    /**
                     * Adding video items to the feed object, one at a time
                     */
                    for (const video of videos) {
                  Severity: Major
                  Found in server/core/controllers/feeds/video-feeds.ts - About 2 hrs to fix

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

                    async function run () {
                      await initDatabaseModels(true)
                    
                      JobQueue.Instance.init()
                    
                    
                    Severity: Minor
                    Found in server/scripts/create-move-video-storage-job.ts - About 2 hrs to fix

                      Function listForApi has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        static listForApi (parameters: {
                          start: number
                          count: number
                          sort: string
                          search?: string
                      Severity: Minor
                      Found in server/core/models/account/account-blocklist.ts - About 2 hrs to fix

                        Function buildVideosFromRows has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          buildVideosFromRows (options: {
                            rows: SQLRow[]
                            include?: VideoIncludeType
                            rowsWebVideoFiles?: SQLRow[]
                            rowsStreamingPlaylist?: SQLRow[]
                        Severity: Minor
                        Found in server/core/models/video/sql/video/shared/video-model-builder.ts - About 2 hrs to fix

                          Function getBypassFromPasswordGrant has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          async function getBypassFromPasswordGrant (username: string, password: string): Promise<BypassLogin> {
                            const plugins = PluginManager.Instance.getIdAndPassAuths()
                            const pluginAuths: { npmName?: string, registerAuthOptions: RegisterServerAuthPassOptions }[] = []
                          
                            for (const plugin of plugins) {
                          Severity: Minor
                          Found in server/core/lib/auth/external-auth.ts - About 2 hrs to fix

                            Function generateSubtitle has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export async function generateSubtitle (options: {
                              video: MVideoUUID
                            }) {
                              const outputPath = join(CONFIG.STORAGE.TMP_DIR, 'transcription', buildSUUID())
                            
                            
                            Severity: Minor
                            Found in server/core/lib/video-captions.ts - About 2 hrs to fix

                              Function buildImporters has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                private buildImporters (user: MUserDefault) {
                                  // Keep consistency in import order (don't import videos before channels for example)
                                  return [
                                    {
                                      name: 'account' as 'account',
                              Severity: Minor
                              Found in server/core/lib/user-import-export/user-importer.ts - About 2 hrs to fix

                                Function getStats has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  async getStats () {
                                    const { totalLocalVideos, totalLocalVideoViews, totalVideos } = await VideoModel.getStats()
                                    const { totalLocalVideoComments, totalVideoComments } = await VideoCommentModel.getStats()
                                    const {
                                      totalUsers,
                                Severity: Minor
                                Found in server/core/lib/stat-manager.ts - About 2 hrs to fix

                                  Function getContextMenuOptions has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private getContextMenuOptions () {
                                  
                                      const content = () => {
                                        const self = this
                                        const player = this.player
                                  Severity: Minor
                                  Found in client/src/assets/player/peertube-player.ts - About 2 hrs to fix

                                    Function updateForm has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      updateForm () {
                                        const defaultValues: any = {
                                          nsfw: 'false',
                                          commentsPolicy: this.serverConfig.defaults.publish.commentsPolicy,
                                          downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled,
                                    Severity: Minor
                                    Found in client/src/app/+videos/+video-edit/shared/video-edit.component.ts - About 2 hrs to fix

                                      Function processAudioMergeTranscoding has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export async function processAudioMergeTranscoding (options: ProcessOptions<RunnerJobVODAudioMergeTranscodingPayload>) {
                                        const { server, job, runnerToken } = options
                                        const payload = job.payload
                                      
                                        let ffmpegProgress: number
                                      Severity: Minor
                                      Found in apps/peertube-runner/src/server/process/shared/process-vod.ts - About 2 hrs to fix

                                        Function buildResumeUpload has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          protected async buildResumeUpload <T> (options: OverrideCommandOptions & {
                                            path: string
                                        
                                            fixture: string
                                            attaches?: Record<string, string>
                                        Severity: Minor
                                        Found in packages/server-commands/src/shared/abstract-command.ts - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language