Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function getMetadataStream has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private getMetadataStream (streams: any[], type: 'video' | 'audio') {
    const stream = streams.find(s => s.codec_type === type)
    if (!stream) return undefined

    let keyToTranslateFunction = {

    Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      constructor (hash: ServerVideoPlaylist, translations: { [ id: string ]: string }) {
        const absoluteAPIUrl = getAbsoluteAPIUrl()
    
        this.id = hash.id
        this.uuid = hash.uuid
    Severity: Minor
    Found in client/src/app/shared/shared-video-playlist/video-playlist.model.ts - About 1 hr to fix

      Function viewReplies has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        viewReplies (commentId: number, highlightThread = false) {
          this.threadLoading[commentId] = true
      
          const params = {
            videoId: this.video.uuid,

        Function getStateLabel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          getStateLabel (video: Video) {
            if (!video.state) return ''
        
            if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) {
              return $localize`Published`

          Function loadPlaylistElements has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            loadPlaylistElements (playlist: VideoPlaylist, redirectToFirst = false, position?: number) {
              const obs = this.hooks.wrapObsFun(
                this.videoPlaylist.getPlaylistVideos.bind(this.videoPlaylist),
                { videoPlaylistId: playlist.uuid, componentPagination: this.playlistPagination },
                'video-watch',

            Function containerBuilder has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              private containerBuilder (el: HTMLElement) {
                const data = el.dataset as ContainerMarkupData
            
                // Move inner HTML in the new element we'll create
                const content = el.innerHTML
            Severity: Minor
            Found in client/src/app/shared/shared-custom-markup/custom-markup.service.ts - About 1 hr to fix

              Function next has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    next: async resultList => {
                      this.totalRecords = resultList.total
              
                      this.abuses = []
              
              

                Function defineGetAccessProgram has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function defineGetAccessProgram () {
                  const program = new Command()
                    .name('get-access-token')
                    .description('Get a peertube access token')
                    .alias('token')
                Severity: Minor
                Found in apps/peertube-cli/src/peertube-get-access-token.ts - About 1 hr to fix

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

                  async function up (utils: {
                    transaction: Sequelize.Transaction
                    queryInterface: Sequelize.QueryInterface
                    sequelize: Sequelize.Sequelize
                    db: any
                  Severity: Minor
                  Found in server/core/initializers/migrations/0585-video-file-names.ts - About 1 hr to fix

                    Function sendCachedResponse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      private sendCachedResponse (request: express.Request, response: express.Response, cacheObject: CacheObject, duration: number) {
                        const headers = response.getHeaders()
                    
                        if (isTestInstance()) {
                          Object.assign(headers, {
                    Severity: Minor
                    Found in server/core/middlewares/cache/shared/api-cache.ts - About 1 hr to fix

                      Function plainTextPlugin has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function plainTextPlugin (markdownIt: any) {
                        function plainTextRule (state: any) {
                          const text = scan(state.tokens)
                      
                          markdownIt.plainText = text
                      Severity: Minor
                      Found in server/core/helpers/markdown.ts - About 1 hr to fix

                        Function createUserAccountAndChannelAndPlaylist has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        async function createUserAccountAndChannelAndPlaylist (parameters: {
                          userToCreate: MUser
                          userDisplayName?: string
                          channelNames?: ChannelNames
                          validateUser?: boolean
                        Severity: Minor
                        Found in server/core/lib/user.ts - About 1 hr to fix

                          Function insertFromImportIntoDB has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          async function insertFromImportIntoDB (parameters: {
                            video: MVideoThumbnail
                            thumbnailModel: MThumbnail
                            previewModel: MThumbnail
                            videoChannel: MChannelAccountDefault
                          Severity: Minor
                          Found in server/core/lib/video-pre-import.ts - About 1 hr to fix

                            Function onTranscriptionEnded has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export async function onTranscriptionEnded (options: {
                              video: MVideoFullLight
                              language: string
                              vttPath: string
                              lTags?: (string | number)[]
                            Severity: Minor
                            Found in server/core/lib/video-captions.ts - About 1 hr to fix

                              Function checkVideoFileCanBeEdited has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function checkVideoFileCanBeEdited (video: MVideo, res: express.Response) {
                                if (video.isLive) {
                                  res.fail({
                                    status: HttpStatusCode.BAD_REQUEST_400,
                                    message: 'Cannot edit a live video'

                                Function checkVideoCanBeTranscribedOrTranscripted has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function checkVideoCanBeTranscribedOrTranscripted (video: MVideo, res: express.Response) {
                                  if (video.remote) {
                                    res.fail({
                                      status: HttpStatusCode.BAD_REQUEST_400,
                                      message: 'Cannot run this task on a remote video'

                                  Function importObject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    protected async importObject (channelImportData: SanitizedObject) {
                                      const account = this.user.Account
                                      const existingChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(channelImportData.name)
                                  
                                      if (existingChannel) {
                                  Severity: Minor
                                  Found in server/core/lib/user-import-export/importers/channels-importer.ts - About 1 hr to fix

                                    Function saveNewOriginalFileIfNeeded has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export async function saveNewOriginalFileIfNeeded (video: MVideo, videoFile: MVideoFile) {
                                      if (!CONFIG.TRANSCODING.ORIGINAL_FILE.KEEP) return
                                    
                                      const videoSource = await VideoSourceModel.loadLatest(video.id)
                                    
                                    
                                    Severity: Minor
                                    Found in server/core/lib/video-file.ts - About 1 hr to fix

                                      Function crawlCollectionPage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      async function crawlCollectionPage <T> (argUrl: string, handler: HandlerFunction<T>, cleaner?: CleanerFunction) {
                                        let url = argUrl
                                      
                                        logger.info('Crawling ActivityPub data on %s.', url)
                                      
                                      
                                      Severity: Minor
                                      Found in server/core/lib/activitypub/crawl.ts - About 1 hr to fix

                                        Function registerSourceHandler has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const registerSourceHandler = function (vjs: typeof videojs) {
                                          if (!Hlsjs.isSupported()) {
                                            logger.info('Hls.js is not supported in this browser.')
                                            return
                                          }
                                        Severity: Minor
                                        Found in client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language