Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function generateVideoCommentsFeed has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function generateVideoCommentsFeed (req: express.Request, res: express.Response) {
  const start = 0
  const video = res.locals.videoAll
  const account = res.locals.account
  const videoChannel = res.locals.videoChannel
Severity: Minor
Found in server/core/controllers/feeds/comment-feeds.ts - About 1 hr to fix

    Function getFiles has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getFiles: async (id: number | string) => {
          const video = await VideoModel.loadFull(id)
          if (!video) return undefined
    
          const webVideoFiles = (video.VideoFiles || []).map(f => ({
    Severity: Minor
    Found in server/core/lib/plugins/plugin-helpers-builder.ts - About 1 hr to fix

      Function replaceLiveByReplay has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      async function replaceLiveByReplay (options: {
        video: MVideo
        liveSession: MVideoLiveSession
        live: MVideoLive
        permanentLive: boolean
      Severity: Minor
      Found in server/core/lib/job-queue/handlers/video-live-ending.ts - About 1 hr to fix

        Function addTags has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static async addTags (htmlStringPage: string, tagsValues: Tags, context: HookContext) {
            const openGraphMetaTags = this.generateOpenGraphMetaTagsOptions(tagsValues)
            const standardMetaTags = this.generateStandardMetaTagsOptions(tagsValues)
            const twitterCardMetaTags = this.generateTwitterCardMetaTagsOptions(tagsValues)
            const schemaTags = await this.generateSchemaTagsOptions(tagsValues, context)
        Severity: Minor
        Found in server/core/lib/html/shared/tags-html.ts - About 1 hr to fix

          Function generateHlsPlaylistCommon has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function generateHlsPlaylistCommon (options: {
            type: 'hls' | 'hls-from-ts'
            video: MVideo
          
            videoInputPath: string
          Severity: Minor
          Found in server/core/lib/transcoding/hls-transcoding.ts - About 1 hr to fix

            Function onHLSVideoFileTranscoding has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function onHLSVideoFileTranscoding (options: {
              video: MVideo
              videoOutputPath: string
              m3u8OutputPath: string
              filesLockedInParent?: boolean // default false
            Severity: Minor
            Found in server/core/lib/transcoding/hls-transcoding.ts - About 1 hr to fix

              Function upload has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async upload (options: OverrideCommandOptions & {
                  attributes?: VideoEdit
                  mode?: 'legacy' | 'resumable' // default legacy
                  waitTorrentGeneration?: boolean // default true
                  completedExpectedStatus?: HttpStatusCodeType
              Severity: Minor
              Found in packages/server-commands/src/videos/videos-command.ts - About 1 hr to fix

                Function up has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function up (utils: {
                  transaction: Sequelize.Transaction
                  queryInterface: Sequelize.QueryInterface
                  sequelize: Sequelize.Sequelize
                  db: any

                  Function processVideo has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  async function processVideo (videoId: number) {
                    const video = await VideoModel.loadWithFiles(videoId)
                    if (video.isLive) return
                  
                    const files = await Promise.all(video.getAllFiles().map(f => VideoFileModel.loadWithMetadata(f.id)))
                  Severity: Minor
                  Found in server/scripts/migrations/peertube-6.3.ts - About 1 hr to fix

                    Function toActivityPubObject has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      toActivityPubObject (this: MCommentAP, threadParentComments: MCommentOwner[]): VideoCommentObject | ActivityTombstoneObject {
                        const inReplyTo = this.inReplyToCommentId === null
                          ? this.Video.url // New thread, so we reply to the video
                          : this.InReplyToVideoComment.url
                    
                    
                    Severity: Minor
                    Found in server/core/models/video/video-comment.ts - About 1 hr to fix

                      Function generatePodcastItem has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      async function generatePodcastItem (options: {
                        video: VideoModel
                        liveItem: boolean
                        media: PodcastMedia[]
                      }) {
                      Severity: Minor
                      Found in server/core/controllers/feeds/video-podcast-feeds.ts - About 1 hr to fix

                        Function makeResponseCacheable has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          private makeResponseCacheable (res: express.Response, next: express.NextFunction, key: string, duration: number) {
                            const self = this
                        
                            res.locals.apicache = {
                              write: res.write.bind(res),
                        Severity: Minor
                        Found in server/core/middlewares/cache/shared/api-cache.ts - About 1 hr to fix

                          Function init has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            init (server: HTTPServer) {
                              const io = new SocketServer(server, {
                                cors: isDevInstance()
                                  ? { origin: 'http://localhost:5173', methods: [ 'GET', 'POST' ] }
                                  : undefined
                          Severity: Minor
                          Found in server/core/lib/peertube-socket.ts - About 1 hr to fix

                            Function createEl has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              createEl () {
                                this.menuItems = []
                            
                                const menu = super.createEl('div', {
                                  className: 'vjs-playlist-menu',
                            Severity: Minor
                            Found in client/src/assets/player/shared/playlist/playlist-menu.ts - About 1 hr to fix

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

                              async function run () {
                                const excludeList = getContributorsExcludeList()
                              
                                {
                                  let contributors = await getGitContributors()
                              Severity: Minor
                              Found in scripts/generate-code-contributors.ts - About 1 hr to fix

                                Function onVideoFetched has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  private async onVideoFetched (options: {
                                    video: VideoDetails
                                    live: LiveVideo
                                    videoCaptions: VideoCaption[]
                                    videoChapters: VideoChapter[]
                                Severity: Minor
                                Found in client/src/app/+videos/+video-watch/video-watch.component.ts - About 1 hr to fix

                                  Function buildPlaylistOptions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private buildPlaylistOptions (options?: {
                                      playlistTracker: PlaylistTracker
                                      playNext: () => any
                                      playPrevious: () => any
                                      onVideoUpdate: (uuid: string) => any
                                  Severity: Minor
                                  Found in client/src/standalone/videos/shared/player-options-builder.ts - About 1 hr to fix

                                    Function buildLibraryLinks has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      buildLibraryLinks (userCanSeeVideosLink: boolean): MenuSection {
                                        let links: MenuLink[] = []
                                    
                                        if (userCanSeeVideosLink) {
                                          links.push({
                                    Severity: Minor
                                    Found in client/src/app/core/menu/menu.service.ts - About 1 hr to fix

                                      Function buildConfig has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function buildConfig (suiteFile: string = undefined) {
                                        const filename = basename(suiteFile)
                                      
                                        if (filename === 'custom-server-defaults.e2e-spec.ts') {
                                          return {
                                      Severity: Minor
                                      Found in client/e2e/src/utils/hooks.ts - About 1 hr to fix

                                        Function buildAdditionalAttributes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function buildAdditionalAttributes (video: MVideoFormattable, options: VideoFormattingJSONOptions) {
                                          const add = options.additionalAttributes
                                        
                                          const result: Partial<VideoAdditionalAttributes> = {}
                                        
                                        
                                        Severity: Minor
                                        Found in server/core/models/video/formatter/video-api-format.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language