evrimfeyyaz/covid-19-in-charts

View on GitHub
src/utilities/covid19ApiUtilities.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Showing 0 of 3 total issues

Function pluralizeProperty has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

export function pluralizeProperty(
property: keyof Omit<ValuesOnDate, "date" | "caseFatalityRate" | "recoveryRate">,
value: number
): string {
const propertyNames: (keyof ValuesOnDate)[] = [
Severity: Minor
Found in src/utilities/covid19ApiUtilities.ts - About 1 hr to fix

    Function getFormattedValuesOnDate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

    export function getFormattedValuesOnDate(values: ValuesOnDate): FormattedValuesOnDate {
    const formattedValues: FormattedValuesOnDate = {
    date: getFormattedDate(dateKeyToDate(values.date)),
    confirmed: numToGroupedString(values.confirmed),
    newConfirmed: numToGroupedString(values.newConfirmed),
    Severity: Minor
    Found in src/utilities/covid19ApiUtilities.ts - About 1 hr to fix

      Function getFormattedValuesOnDate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Invalid

      export function getFormattedValuesOnDate(values: ValuesOnDate): FormattedValuesOnDate {
      const formattedValues: FormattedValuesOnDate = {
      date: getFormattedDate(dateKeyToDate(values.date)),
      confirmed: numToGroupedString(values.confirmed),
      newConfirmed: numToGroupedString(values.newConfirmed),
      Severity: Minor
      Found in src/utilities/covid19ApiUtilities.ts - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status