Showing 14 of 83 total issues
Function get_pin_code_from_mail
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function get_pin_code_from_mail(): Promise<string> {
const gmail_user = process.env.GMAIL_USER ?? ''
const gmail_password = process.env.GMAIL_PASS ?? ''
// expect(gmail_user).toBeDefined()
Function find_many
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async find_many(text_id: TextId, locale_code: LocaleCode): Promise<Text[]> {
const text_repository: TextRepository = new TextRepositoryPrisma(this._prisma_client)
const text = await text_repository.find_by_id(text_id)
const locale_repository: LocaleRepository = new LocaleRepositoryPrisma(this._prisma_client)
const locale = await locale_repository.find_unique(locale_code)
Function execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async execute(): Promise<Text[]> {
const text_id = new TextId(this._text.id)
const found_translations = await this._translation_repository.find_many(
text_id,
Function speak
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async speak(): Promise<SpeechSound> {
const speech_config = MicrosoftSpeechSdk.SpeechConfig.fromSubscription(
MICROSOFT_SPEECH_KEY,
SpeechByMicrosoft._region
)
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async execute(): Promise<Text[]> {
const text_id = new TextId(this._text.id)
const found_translations = await this._translation_repository.find_many(
text_id,
- 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 execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async execute(): Promise<Text> {
const found_text = await this._text_repository.find(this._locale_code, this._speech_text)
if (found_text) return found_text
- 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
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
if (this._event.metaKey) return false
Avoid too many return
statements within this function. Open
return OS.linux
Avoid too many return
statements within this function. Open
return ''
Avoid too many return
statements within this function. Open
return OS.unknown
Function get_os
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static get_os(): OS {
const user_agent = window.navigator.userAgent
const platform = navigator?.userAgentData?.platform || navigator?.platform
if (this._macos_platforms.includes(platform)) {
- 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 get_speech_sounds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function get_speech_sounds(
speech_texts: SpeechText[],
locale_code: LocaleCode
): Promise<SpeechSound[]> {
const speech_sounds: SpeechSound[] = []
- 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 _set_on_result
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private _set_on_result(): void {
this._final_transcript = ''
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this._recognition.onresult = (event: any): void => {
- 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"