Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function prune has 38 lines of code (exceeds 25 allowed). Consider refactoring.
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.')
Severity: Minor
Found in server/scripts/prune-storage.ts - About 1 hr to fix

    Function videoFilesModelToFormattedJSON has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function videoFilesModelToFormattedJSON (
      video: MVideoFormattable,
      videoFiles: MVideoFileRedundanciesOpt[],
      options: {
        includeMagnet?: boolean // default true
    Severity: Minor
    Found in server/core/models/video/formatter/video-api-format.ts - About 1 hr to fix

      Function buildVideoMimetypeExt has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function buildVideoMimetypeExt () {
        const data = {
          // streamable formats that warrant cross-browser compatibility
          'video/webm': '.webm',
          // We'll add .ogg if additional extensions are enabled
      Severity: Minor
      Found in server/core/initializers/constants.ts - About 1 hr to fix

        Function getOutputFromFile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function getOutputFromFile (options: {
          path: string
          startDate: Date
          endDate: Date
          level: ServerLogLevel
        Severity: Minor
        Found in server/core/controllers/api/server/logs.ts - About 1 hr to fix

          Function watchTSFiles has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            private watchTSFiles () {
              const startStreamDateTime = new Date().getTime()
          
              const addHandler = async (segmentPath: string) => {
                if (segmentPath.endsWith('.ts') !== true) return
          Severity: Minor
          Found in server/core/lib/live/shared/muxing-session.ts - About 1 hr to fix

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

              Function buildTranscodingManager has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private buildTranscodingManager () {
                  const self = this
              
                  function addProfile (type: 'live' | 'vod', encoder: string, profile: string, builder: EncoderOptionsBuilder) {
                    if (profile === 'default') {
              Severity: Minor
              Found in server/core/lib/plugins/register-helpers.ts - About 1 hr to fix

                Function processVideoLiveEnding has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function processVideoLiveEnding (job: Job) {
                  const payload = job.data as VideoLiveEndingPayload
                
                  logger.info('Processing video live ending for %s.', payload.videoId, { payload, ...lTags() })
                
                
                Severity: Minor
                Found in server/core/lib/job-queue/handlers/video-live-ending.ts - About 1 hr to fix

                  Function processDeleteActivity has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  async function processDeleteActivity (options: APProcessorOptions<ActivityDelete>) {
                    const { activity, byActor } = options
                  
                    const objectUrl = typeof activity.object === 'string' ? activity.object : activity.object.id
                  
                  
                  Severity: Minor
                  Found in server/core/lib/activitypub/process/process-delete.ts - About 1 hr to fix

                    Function initTouchStartEvents has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      private initTouchStartEvents () {
                        const handleTouchStart = (event: TouchEvent, onlyDetectDoubleTap = false) => {
                          debugLogger('Handle touch start')
                    
                          if (this.tapTimeout) {
                    Severity: Minor
                    Found in client/src/assets/player/shared/mobile/peertube-mobile-plugin.ts - About 1 hr to fix

                      Function onContextMenu has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      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.
                      Severity: Minor
                      Found in client/src/assets/player/shared/context-menu/context-menu-plugin.ts - About 1 hr to fix

                        Function importVideo has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          importVideo () {
                            this.isImportingVideo = true
                        
                            const videoUpdate: VideoUpdate = {
                              privacy: this.highestPrivacy,

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

                              show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) {
                                let subtitle: string
                                if (this.videoCaptions && this.videoCaptions.length !== 0) {
                                  subtitle = this.videoCaptions[0].language.id
                                }
                            Severity: Minor
                            Found in client/src/app/shared/shared-share-modal/video-share.component.ts - About 1 hr to fix

                              Function setupStateTracking has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                private setupStateTracking () {
                                  let currentState: 'playing' | 'paused' | 'unstarted' | 'ended' = 'unstarted'
                              
                                  this.videoElInterval = setInterval(() => {
                                    const position = this.player?.currentTime() ?? 0
                              Severity: Minor
                              Found in client/src/standalone/videos/embed-api.ts - About 1 hr to fix

                                Function deleteRemoteFiles has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                async function deleteRemoteFiles () {
                                  console.log('Detecting remote files that can be deleted...')
                                
                                  const thumbnails = await ThumbnailModel.listRemoteOnDisk()
                                  const actorImages = await ActorImageModel.listRemoteOnDisk()
                                Severity: Minor
                                Found in server/scripts/house-keeping.ts - About 1 hr to fix

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

                                  async function run () {
                                    await initDatabaseModels(true)
                                  
                                    {
                                      console.log('## Updating "formatFlags" column for web videos in "videoFile" table in database ##\n')
                                  Severity: Minor
                                  Found in server/scripts/migrations/peertube-6.3.ts - About 1 hr to fix

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

                                      static listForApi (options: {
                                        start: number
                                        count: number
                                        videoPlaylistId: number
                                        serverAccount: AccountModel
                                    Severity: Minor
                                    Found in server/core/models/video/video-playlist-element.ts - About 1 hr to fix

                                      Function listHandlesBlockedBy has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        static listHandlesBlockedBy (accountIds: number[]): Promise<string[]> {
                                          const query = {
                                            attributes: [ 'id' ],
                                            where: {
                                              accountId: {
                                      Severity: Minor
                                      Found in server/core/models/account/account-blocklist.ts - About 1 hr to fix

                                        Function generateSchemaTagsOptions has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                        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')
                                        Severity: Minor
                                        Found in server/core/lib/html/shared/tags-html.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language