patrickmichalina/camera-probe

View on GitHub

Showing 2 of 8 total issues

Function xmlToOnvifDevice has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const xmlToOnvifDevice = (doc: Document) => (notfoundStr = 'unknown'): IOnvifDevice => {
  const simpleParse = (elm: Document | Element) => (ns: string) => (node: string) => maybe(elm.getElementsByTagNameNS(ns, node).item(0))
  const maybeRootProbeElement = maybe(doc.getElementsByTagNameNS(SCHEMAS.discovery, 'ProbeMatch').item(0))

  return maybeRootProbeElement.map<IOnvifDevice>(rootElement => {
Severity: Major
Found in src/onvif/parse.ts - About 2 hrs to fix

    Function probe has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            Observable.create((obs: Observer<Strings>) => {
              const cfg = { ...DEFAULT_PROBE_CONFIG, ...(config || {}) }
              const socket = createSocket({ type: 'udp4' })
              const socketMessages$ = fromEvent<IMessage>(socket, 'message').pipe(map(a => a[0]), shareReplay(1))
              const internalLimit = new Subject()
    Severity: Minor
    Found in src/core/probe.ts - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language