File manage-metadata.ts
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { program } from 'commander'
import yaml from 'js-yaml'
import fs from 'node:fs'
import path from 'node:path'
Function formatDevelopmentNotes
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const formatDevelopmentNotes = (params: { notes: NoteType[]; language: string; platforms: string[] }) => {
const { notes, language, platforms } = params
const emptyNotesMap = {
common: [] as NoteType[],
android: [] as NoteType[],
Function writeMetadata
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const writeMetadata = (appName: string, storeName: string, overrideVersionName?: string) => {
if (storeName !== 'appstore' && storeName !== 'playstore') {
throw new Error(`Invalid store name ${storeName} passed!`)
}
Function parseReleaseNotes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const parseReleaseNotes = ({ source, ios, android, web, production, language, appName }: ParseOptions): string => {
const platforms: string[] = [
android ? PLATFORM_ANDROID : undefined,
ios ? PLATFORM_IOS : undefined,
web ? PLATFORM_WEB : undefined,
- 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 formatNotes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const formatNotes = (params: {
notes: NoteType[]
language: string
production: boolean
platformName?: 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 formatDevelopmentNotes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const formatDevelopmentNotes = (params: { notes: NoteType[]; language: string; platforms: string[] }) => {
const { notes, language, platforms } = params
const emptyNotesMap = {
common: [] as NoteType[],
android: [] as NoteType[],
- 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"