Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function loadLocalByName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static loadLocalByName (name: string): Promise<MAccountDefault> {
    const fun = () => {
      const query = {
        where: {
          [Op.or]: [
Severity: Minor
Found in server/core/models/account/account.ts - About 1 hr to fix

    Function listThreadsForApi has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static async listThreadsForApi (parameters: {
        video: MVideo
        start: number
        count: number
        sort: string
    Severity: Minor
    Found in server/core/models/video/video-comment.ts - About 1 hr to fix

      Function unzip has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function unzip (source: string, destination: string) {
        await ensureDir(destination)
      
        logger.info(`Unzip ${source} to ${destination}`, lTags())
      
      
      Severity: Minor
      Found in server/core/helpers/unzip.ts - About 1 hr to fix

        Function videoFilesDeleteHLSFileValidator has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async (req: express.Request, res: express.Response, next: express.NextFunction) => {
            if (areValidationErrors(req, res)) return
            if (!await doesVideoExist(req.params.id, res)) return
        
            const video = res.locals.videoAll
        Severity: Minor
        Found in server/core/middlewares/validators/videos/video-files.ts - About 1 hr to fix

          Function jobOfRunnerGetValidatorFactory has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function jobOfRunnerGetValidatorFactory (allowedStates: RunnerJobStateType[]) {
            return [
              param('jobUUID').custom(isUUIDValid),
          
              body('runnerToken').custom(isRunnerTokenValid),
          Severity: Minor
          Found in server/core/middlewares/validators/runners/jobs.ts - About 1 hr to fix

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

              async run () {
                this.running = true
            
                if (CONFIG.LIVE.RTMP.ENABLED) {
                  logger.info('Running RTMP server on port %d', CONFIG.LIVE.RTMP.PORT, lTags())
            Severity: Minor
            Found in server/core/lib/live/live-manager.ts - About 1 hr to fix

              Function buildObservers has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                buildObservers () {
                  const activeInfohashes = this.meter.createObservableGauge('peertube_bittorrent_tracker_active_infohashes_total', {
                    description: 'Total active infohashes in the PeerTube BitTorrent Tracker'
                  })
                  const inactiveInfohashes = this.meter.createObservableGauge('peertube_bittorrent_tracker_inactive_infohashes_total', {

                Function processActivityPubFollow has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function processActivityPubFollow (job: Job) {
                  const payload = job.data as ActivitypubFollowPayload
                  const host = payload.host
                
                  const handle = host
                Severity: Minor
                Found in server/core/lib/job-queue/handlers/activitypub-follow.ts - About 1 hr to fix

                  Function registerPluginOrTheme has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    private async registerPluginOrTheme (plugin: PluginModel) {
                      const npmName = PluginModel.buildNpmName(plugin.name, plugin.type)
                  
                      logger.info('Registering plugin or theme %s.', npmName)
                  
                  
                  Severity: Minor
                  Found in server/core/lib/plugins/plugin-manager.ts - About 1 hr to fix

                    Function loadDynamicPlugins has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      private loadDynamicPlugins () {
                        if (isMobile()) this.player.peertubeMobile()
                    
                        this.player.bezels()
                    
                    
                    Severity: Minor
                    Found in client/src/assets/player/peertube-player.ts - About 1 hr to fix

                      Function initializePlugin has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        private initializePlugin () {
                          initHlsJsPlayer(this.player, this.hlsjs)
                      
                          this.p2pEngine.on(Events.SegmentError, (segment: Segment, err) => {
                            if (navigator.onLine === false || this.liveEnded) return

                        Function trackPrivacyChange has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          private trackPrivacyChange () {
                            // We will update the schedule input and the wait transcoding checkbox validators
                            this.form.controls['privacy']
                              .valueChanges
                              .pipe(map(res => parseInt(res.toString(), 10)))
                        Severity: Minor
                        Found in client/src/app/+videos/+video-edit/shared/video-edit.component.ts - About 1 hr to fix

                          Function ngOnInit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            ngOnInit () {
                              this.buildForm({
                                displayName: VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR,
                                privacy: VIDEO_PLAYLIST_PRIVACY_VALIDATOR,
                                description: VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR,

                            Function ngOnInit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              ngOnInit () {
                                this.subscribeToVideoRequests()
                            
                                const hiddenFilters = this.hideScopeFilter
                                  ? [ 'scope' ]

                              Function loadMoreChannels has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                loadMoreChannels () {
                                  const options = {
                                    account: this.account,
                                    componentPagination: this.channelPagination,
                                    sort: '-updatedAt'

                                Function onTouchMove has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    const onTouchMove = (event: TouchEvent) => {
                                      if (!touchDownClientX || !touchDownClientY) {
                                        return
                                      }
                                
                                
                                Severity: Minor
                                Found in client/src/app/core/wrappers/screen.service.ts - About 1 hr to fix

                                  Function add has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    add (hotkey: Hotkey | Hotkey[]): Hotkey[] | Hotkey {
                                      if (Array.isArray(hotkey)) {
                                        return hotkey.map(h => this.add(h))
                                      }
                                  
                                  
                                  Severity: Minor
                                  Found in client/src/app/core/hotkeys/hotkeys.service.ts - About 1 hr to fix

                                    Function refreshingTokenPromise has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            const refreshingTokenPromise = new Promise<void>((resolve, reject) => {
                                              const clientId: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID)
                                              const clientSecret: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
                                    
                                              const headers = new Headers()
                                    Severity: Minor
                                    Found in client/src/standalone/videos/shared/auth-http.ts - About 1 hr to fix

                                      Function checkAvailableJobs has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        private async checkAvailableJobs () {
                                          if (!this.initialized) return
                                          if (this.checkingAvailableJobs) return
                                      
                                          this.checkingAvailableJobs = true
                                      Severity: Minor
                                      Found in apps/peertube-runner/src/server/server.ts - About 1 hr to fix

                                        Function getRemoteObjectOrDie has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function getRemoteObjectOrDie (
                                          options: CommonProgramOptions,
                                          settings: Settings,
                                          netrc: Netrc
                                        ): { url: string, username: string, password: string } {
                                        Severity: Minor
                                        Found in apps/peertube-cli/src/shared/cli.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language