apps/peertube-runner/src/server/process/shared/process-live.ts
Function process
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
process () {
const job = this.options.job
const payload = job.payload
return new Promise<void>(async (res, rej) => {
File process-live.ts
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { wait } from '@peertube/peertube-core-utils'
import {
ffprobePromise,
getVideoStreamBitrate,
getVideoStreamDimensionsInfo,
Function sendPendingChunks
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async sendPendingChunks (): Promise<any> {
if (this.ended) return Promise.resolve()
const parallelPromises: Promise<any>[] = []
Function sendPendingChunks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
private async sendPendingChunks (): Promise<any> {
if (this.ended) return Promise.resolve()
const parallelPromises: Promise<any>[] = []
- 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 updateWithRetry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private async updateWithRetry (payload: CustomLiveRTMPHLSTranscodingUpdatePayload, currentTry = 1): Promise<any> {
if (this.ended || this.errored) return
try {
await this.options.server.runnerJobs.update({
- 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"