Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

Function isSignupAllowedForCurrentIP has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function isSignupAllowedForCurrentIP (ip: string) {
  if (!ip) return false

  const addr = ipaddr.parse(ip)
  const excludeList = [ 'blacklist' ]
Severity: Minor
Found in server/core/lib/signup.ts - About 1 hr to fix

    Function computeResolutionsToTranscode has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function computeResolutionsToTranscode (options: {
      input: number
      type: 'vod' | 'live'
      includeInput: boolean
      strictLower: boolean
    Severity: Minor
    Found in server/core/lib/transcoding/transcoding-resolutions.ts - About 1 hr to fix

      Function processLikeVideo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      async function processLikeVideo (byActor: MActorSignature, activity: ActivityLike) {
        const videoUrl = getAPId(activity.object)
      
        const byAccount = byActor.Account
        if (!byAccount) throw new Error('Cannot create like with the non account actor ' + byActor.url)
      Severity: Minor
      Found in server/core/lib/activitypub/process/process-like.ts - About 1 hr to fix

        Function updateVideo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private updateVideo (channel: MChannelId, transaction?: Transaction, overrideTo?: string[]) {
            const to = overrideTo || this.videoObject.to
            const videoData = getVideoAttributesFromObject(channel, this.videoObject, to)
            this.video.name = videoData.name
            this.video.uuid = videoData.uuid
        Severity: Minor
        Found in server/core/lib/activitypub/videos/updater.ts - About 1 hr to fix

          Function internalExecute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            protected async internalExecute () {
              for (const redundancyConfig of CONFIG.REDUNDANCY.VIDEOS.STRATEGIES) {
                logger.info('Running redundancy scheduler for strategy %s.', redundancyConfig.strategy, lTags())
          
                try {
          Severity: Minor
          Found in server/core/lib/schedulers/videos-redundancy-scheduler.ts - About 1 hr to fix

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

              constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
                super(player, options)
            
                // Hide bezels on mobile since we already have our mobile overlay
                if (isMobile()) return
            Severity: Minor
            Found in client/src/assets/player/shared/bezels/pause-bezel.ts - About 1 hr to fix

              Function getOrCreateAPVideo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export async function getOrCreateAPVideo (
                options: GetVideoParamAll | GetVideoParamImmutable | GetVideoParamOther
              ): GetVideoResult<MVideoAccountLightBlacklistAllFiles | MVideoThumbnailBlacklist | MVideoImmutable> {
                // Default params
                const syncParam = options.syncParam || { rates: true, shares: true, comments: true, refreshVideo: false }
              Severity: Minor
              Found in server/core/lib/activitypub/videos/get.ts - About 1 hr to fix

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

                  constructor (player: videojs.Player, options?: PlaylistPluginOptions & videojs.ComponentOptions) {
                    super(player, options)
                
                    this.menuItems = []
                
                
                Severity: Minor
                Found in client/src/assets/player/shared/playlist/playlist-menu.ts - About 1 hr to fix

                  Function getMyVideos has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getMyVideos (options: {
                      videoPagination: ComponentPaginationLight
                      sort: VideoSortField
                      userChannels?: VideoChannelServerModel[]
                      search?: string
                  Severity: Minor
                  Found in client/src/app/shared/shared-main/video/video.service.ts - About 1 hr to fix

                    Function ngOnChanges has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      ngOnChanges (changes: SimpleChanges) {
                        if (changes['displayOptions'] || !this.displayOptions) {
                          this.displayOptions = {
                            ...this.defaultDisplayOptions,
                            avatar: this.serverService.getHTMLConfig().client.videos.miniature.displayAuthorAvatar,

                      Function transform has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        transform (arg: number | Date | string) {
                          const argDate = new Date(arg)
                          const seconds = Math.floor((Date.now() - argDate.getTime()) / 1000)
                      
                          let interval = Math.floor(seconds / 31536000)
                      Severity: Minor
                      Found in client/src/app/shared/shared-main/date/from-now.pipe.ts - About 1 hr to fix

                        Function initialize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          initialize () {
                            this.container = this.onItself
                              ? this.el.nativeElement
                              : document.documentElement
                        
                        

                          Function buildServerErrorMessage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            private buildServerErrorMessage (err: any) {
                              // A server-side error occurred.
                              if (err.error?.errors) {
                                const errors = err.error.errors
                          
                          
                          Severity: Minor
                          Found in client/src/app/core/rest/rest-extractor.service.ts - About 1 hr to fix

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

                              ngOnInit () {
                                this.htmlServerConfig = this.serverService.getHTMLConfig()
                                this.currentInterfaceLanguage = this.languageChooserModal.getCurrentLanguage()
                            
                                this.isLoggedIn = this.authService.isLoggedIn()
                            Severity: Minor
                            Found in client/src/app/menu/menu.component.ts - About 1 hr to fix

                              Function produceScroll has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                private produceScroll () {
                                  // When we add the a-state parameter, we don't want to alter the scroll
                                  this.peertubeRouter.getNavigationEndEvents().pipe(pairwise())
                                                    .subscribe(([ e1, e2 ]) => {
                                                      try {
                              Severity: Minor
                              Found in client/src/app/core/routing/scroll.service.ts - About 1 hr to fix

                                Function buildCommentActions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  private buildCommentActions (): DropdownAction<ProcessedAbuse>[] {
                                    if (!this.isAdminView()) return []
                                
                                    return [
                                      {

                                  Function buildMentionPlugin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private buildMentionPlugin () {
                                      if (this.mentionPluginInitialized) return
                                  
                                      const MentionToken = this.linkifyModule.createTokenClass('mention', {
                                        isLink: true,
                                  Severity: Minor
                                  Found in client/src/app/core/renderer/linkifier.service.ts - About 1 hr to fix

                                    Function buildGeoChartOptions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      private buildGeoChartOptions (rawData: GeoData): ChartBuilderResult {
                                        const labels: string[] = []
                                        const data: number[] = []
                                    
                                        for (const d of rawData) {
                                    Severity: Minor
                                    Found in client/src/app/+stats/video/video-stats.component.ts - About 1 hr to fix

                                      Function success has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        success (options: OverrideCommandOptions & RunnerJobSuccessBody & { jobUUID: string }) {
                                          const { payload } = options
                                      
                                          const path = '/api/v1/runners/jobs/' + options.jobUUID + '/success'
                                          const attaches: { [id: string]: any } = {}
                                      Severity: Minor
                                      Found in packages/server-commands/src/runners/runner-jobs-command.ts - About 1 hr to fix

                                        Function getComplexTask has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          static getComplexTask (): VideoStudioTask[] {
                                            return [
                                              // Total duration: 2
                                              {
                                                name: 'cut',
                                        Severity: Minor
                                        Found in packages/server-commands/src/videos/video-studio-command.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language