Showing 1,292 of 3,313 total issues
Function processLikeVideo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function updateVideo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function internalExecute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected async internalExecute () {
for (const redundancyConfig of CONFIG.REDUNDANCY.VIDEOS.STRATEGIES) {
logger.info('Running redundancy scheduler for strategy %s.', redundancyConfig.strategy, lTags())
try {
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function getOrCreateAPVideo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 }
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor (player: videojs.Player, options?: PlaylistPluginOptions & videojs.ComponentOptions) {
super(player, options)
this.menuItems = []
Function getMyVideos
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getMyVideos (options: {
videoPagination: ComponentPaginationLight
sort: VideoSortField
userChannels?: VideoChannelServerModel[]
search?: string
Function ngOnChanges
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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)
Function initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialize () {
this.container = this.onItself
? this.el.nativeElement
: document.documentElement
Function buildServerErrorMessage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildServerErrorMessage (err: any) {
// A server-side error occurred.
if (err.error?.errors) {
const errors = err.error.errors
Function ngOnInit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit () {
this.htmlServerConfig = this.serverService.getHTMLConfig()
this.currentInterfaceLanguage = this.languageChooserModal.getCurrentLanguage()
this.isLoggedIn = this.authService.isLoggedIn()
Function produceScroll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 {
Function buildCommentActions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildCommentActions (): DropdownAction<ProcessedAbuse>[] {
if (!this.isAdminView()) return []
return [
{
Function buildMentionPlugin
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildMentionPlugin () {
if (this.mentionPluginInitialized) return
const MentionToken = this.linkifyModule.createTokenClass('mention', {
isLink: true,
Function buildGeoChartOptions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildGeoChartOptions (rawData: GeoData): ChartBuilderResult {
const labels: string[] = []
const data: number[] = []
for (const d of rawData) {
Function success
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
success (options: OverrideCommandOptions & RunnerJobSuccessBody & { jobUUID: string }) {
const { payload } = options
const path = '/api/v1/runners/jobs/' + options.jobUUID + '/success'
const attaches: { [id: string]: any } = {}
Function getComplexTask
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static getComplexTask (): VideoStudioTask[] {
return [
// Total duration: 2
{
name: 'cut',
Function runCommand
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async runCommand (options: {
silent?: boolean // false by default
} = {}) {
const { silent = false } = options
Function up
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up (utils: {
transaction: Sequelize.Transaction
queryInterface: Sequelize.QueryInterface
sequelize: Sequelize.Sequelize
db: any