value/UnitReplaceCommand.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Function createReplacer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  protected async createReplacer(context: HtmlRR0SsgContext): Promise<DomReplacer> {
    return {
      replace: async (itemEl: HTMLElement) => {
        if (itemEl.getAttribute("itemtype") === "https://schema.org/QuantitativeValue") {
          const propEls = Array.from(itemEl.querySelectorAll("*[itemprop]"))
Severity: Minor
Found in value/UnitReplaceCommand.ts - About 1 hr to fix

    Function replace has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          replace: async (itemEl: HTMLElement) => {
            if (itemEl.getAttribute("itemtype") === "https://schema.org/QuantitativeValue") {
              const propEls = Array.from(itemEl.querySelectorAll("*[itemprop]"))
              const unitPropEl = propEls.find(propEl => propEl.getAttribute("itemprop") === "unitCode")
              const unit = unitPropEl.getAttribute("content")
    Severity: Minor
    Found in value/UnitReplaceCommand.ts - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status