Showing 1,292 of 3,313 total issues
Function doRefresh
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function doRefresh <T extends MActorFull | MActorAccountChannelId> (options: RefreshOptions<T>): RefreshResult <MActorFull> {
const { actor: actorArg, fetchedType } = options
// We need more attributes
const actor = fetchedType === 'all'
Function ngOnInit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit () {
this.confirmService.showConfirm.subscribe(
payload => {
// Reinit fields
this.title = ''
Function generateCaptionOfSpecificVideo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private generateCaptionOfSpecificVideo (options: {
video: Video
forceTranscription: boolean
}): Observable<'success' | 'already-has-captions' | 'already-being-transcribed'> {
const { video, forceTranscription } = options
Function checkTranscodingFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private checkTranscodingFields () {
const transcodingControl = this.form.get('transcoding.enabled')
const videoStudioControl = this.form.get('videoStudio.enabled')
const hlsControl = this.form.get('transcoding.hls.enabled')
const webVideosControl = this.form.get('transcoding.webVideos.enabled')
Function subscribeToVideoRequests
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private subscribeToVideoRequests () {
this.videoRequests
.pipe(
concatMap(({ reset, obsHighlightedLives, obsVideos }) => {
return forkJoin([ obsHighlightedLives, obsVideos ])
Function constructChannel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private constructChannel () {
const channel = Channel.build({ window: window.parent, origin: '*', scope: this.embed.getScope() })
channel.bind('setVideoPassword', (txn, value) => this.embed.setVideoPasswordByAPI(value))
Function buildElement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async buildElement (text: string) {
const html = await this.markdown.customPageMarkdownToHTML({ markdown: text, additionalAllowedTags: this.getSupportedTags() })
const rootElement = document.createElement('div')
rootElement.innerHTML = html
Function buildVODCommand
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async buildVODCommand (options: TranscodeVODOptions & {
videoStreamOnly?: boolean
canCopyAudio?: boolean
canCopyVideo?: boolean
}) {
Function report
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
report (options: OverrideCommandOptions & {
reason: string
accountId?: number
videoId?: number
Function buildMainGetQuery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private buildMainGetQuery (options: BuildVideoGetQueryOptions) {
this.attributes = {
'"video".*': ''
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parseBytes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function parseBytes (value: string | number): number {
if (typeof value === 'number') return value
if (!isNaN(+value)) return +value
const tgm = /^(\d+)\s*TB\s*(\d+)\s*GB\s*(\d+)\s*MB$/
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parseDurationToMs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function parseDurationToMs (duration: number | string): number {
if (duration === null) return null
if (typeof duration === 'number') return duration
if (!isNaN(+duration)) return +duration
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getOutputFromFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function getOutputFromFile (options: {
path: string
startDate: Date
endDate: Date
level: ServerLogLevel
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function initReadersIfNeeded
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private async initReadersIfNeeded () {
if (!this.countryReader) {
let open = true
if (!await pathExists(this.countryDBPath)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function makeResponseCacheable
has a Cognitive Complexity of 10 (exceeds 5 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),
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function skipProcessing
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function skipProcessing (options: {
sourceImage: Jimp
newSize?: { width: number, height: number }
imageBytes: number
inputExt: string
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function buildRateLimiter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function buildRateLimiter (options: {
windowMs: number
max: number
skipFailedRequests?: boolean
}) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function usersCheckCurrentPasswordFactory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const usersCheckCurrentPasswordFactory = (targetUserIdGetter: (req: express.Request) => number | string) => {
return [
body('currentPassword').optional().custom(exists),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function handleSession
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private async handleSession (options: {
sessionId: string
inputLocalUrl: string
inputPublicUrl: string
streamKey: string
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getBypassFromPasswordGrant
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function getBypassFromPasswordGrant (username: string, password: string): Promise<BypassLogin> {
const plugins = PluginManager.Instance.getIdAndPassAuths()
const pluginAuths: { npmName?: string, registerAuthOptions: RegisterServerAuthPassOptions }[] = []
for (const plugin of plugins) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"