{
  "definitions": [
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "core/producers/tool.phpmd.producer.ts",
          "name": "knobs",
          "source": {
            "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpmd-producer-ts",
            "json": "https://banes-lab.com/json/source/quality/core/producers/tool.phpmd.producer.ts",
            "label": "core/producers/tool.phpmd.producer.ts",
            "markdown": "https://banes-lab.com/source/quality/core/producers/tool.phpmd.producer.ts.md",
            "ref": "anatomy:file-quality-core-producers-tool-phpmd-producer-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 28,
      "name": "segments",
      "signature": "const segments = function segments(text: string): string[] {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "core/producers/tool.phpmd.producer.ts",
          "name": "ruleOf",
          "source": {
            "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpmd-producer-ts",
            "json": "https://banes-lab.com/json/source/quality/core/producers/tool.phpmd.producer.ts",
            "label": "core/producers/tool.phpmd.producer.ts",
            "markdown": "https://banes-lab.com/source/quality/core/producers/tool.phpmd.producer.ts.md",
            "ref": "anatomy:file-quality-core-producers-tool-phpmd-producer-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 39,
      "name": "descriptionOf",
      "signature": "const descriptionOf = function descriptionOf(segment: string): string | null {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "core/producers/tool.phpmd.producer.ts",
          "name": "knobs",
          "source": {
            "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpmd-producer-ts",
            "json": "https://banes-lab.com/json/source/quality/core/producers/tool.phpmd.producer.ts",
            "label": "core/producers/tool.phpmd.producer.ts",
            "markdown": "https://banes-lab.com/source/quality/core/producers/tool.phpmd.producer.ts.md",
            "ref": "anatomy:file-quality-core-producers-tool-phpmd-producer-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 68,
      "name": "rulesets",
      "signature": "const rulesets = async function rulesets(): Promise<[string, string][]> {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/producers/tool.phpmd.producer.ts",
          "name": "rulesets",
          "source": {
            "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpmd-producer-ts",
            "json": "https://banes-lab.com/json/source/quality/core/producers/tool.phpmd.producer.ts",
            "label": "core/producers/tool.phpmd.producer.ts",
            "markdown": "https://banes-lab.com/source/quality/core/producers/tool.phpmd.producer.ts.md",
            "ref": "anatomy:file-quality-core-producers-tool-phpmd-producer-ts"
          }
        },
        {
          "file": "core/producers/tool.phpmd.producer.ts",
          "name": "segments",
          "source": {
            "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpmd-producer-ts",
            "json": "https://banes-lab.com/json/source/quality/core/producers/tool.phpmd.producer.ts",
            "label": "core/producers/tool.phpmd.producer.ts",
            "markdown": "https://banes-lab.com/source/quality/core/producers/tool.phpmd.producer.ts.md",
            "ref": "anatomy:file-quality-core-producers-tool-phpmd-producer-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 97,
      "name": "knobs",
      "signature": "const knobs = async function knobs(): Promise<KnobEntry[]> {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/producers/tool.phpmd.producer.ts",
          "name": "descriptionOf",
          "source": {
            "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpmd-producer-ts",
            "json": "https://banes-lab.com/json/source/quality/core/producers/tool.phpmd.producer.ts",
            "label": "core/producers/tool.phpmd.producer.ts",
            "markdown": "https://banes-lab.com/source/quality/core/producers/tool.phpmd.producer.ts.md",
            "ref": "anatomy:file-quality-core-producers-tool-phpmd-producer-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 46,
      "name": "ruleOf",
      "signature": "const ruleOf = function ruleOf(segment: string, ruleset: string): CatalogRule[] {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "core/aggregators/catalog.aggregator.ts",
          "name": "tallyBy",
          "source": {
            "href": "https://banes-lab.com/anatomy/quality#file-quality-core-aggregators-catalog-aggregator-ts",
            "json": "https://banes-lab.com/json/source/quality/core/aggregators/catalog.aggregator.ts",
            "label": "core/aggregators/catalog.aggregator.ts",
            "markdown": "https://banes-lab.com/source/quality/core/aggregators/catalog.aggregator.ts.md",
            "ref": "anatomy:file-quality-core-aggregators-catalog-aggregator-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 73,
      "name": "produce",
      "signature": "const produce = async function produce(): Promise<CatalogProduct[]> {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 9,
      "name": "TOOL",
      "signature": "const TOOL = \"phpmd\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 10,
      "name": "VERSION",
      "signature": "const VERSION = \"master\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 11,
      "name": "SOURCE_ROOT",
      "signature": "const SOURCE_ROOT = \"https://raw.githubusercontent.com/phpmd/phpmd/master/src/main/resources/rulesets\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 12,
      "name": "DOCS",
      "signature": "const DOCS = \"https://phpmd.org/rules\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 13,
      "name": "RULESETS",
      "signature": "const RULESETS = [\"cleancode\", \"codesize\", \"controversial\", \"design\", \"naming\", \"unusedcode\"];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 14,
      "name": "RULE_OPEN",
      "signature": "const RULE_OPEN = '<rule name=\"';"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 15,
      "name": "RULE_CLOSE",
      "signature": "const RULE_CLOSE = \"</rule>\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 16,
      "name": "DESCRIPTION_OPEN",
      "signature": "const DESCRIPTION_OPEN = \"<description>\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 17,
      "name": "DESCRIPTION_CLOSE",
      "signature": "const DESCRIPTION_CLOSE = \"</description>\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 18,
      "name": "KNOB_PROPERTIES",
      "signature": "const KNOB_PROPERTIES = [\"reportLevel\", \"minimum\", \"maximum\"];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 19,
      "name": "PROPERTY_WINDOW",
      "signature": "const PROPERTY_WINDOW = 200;"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 21,
      "name": "attr",
      "signature": "const attr = function attr(tag: string, key: string): string | null {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 22,
      "name": "needle",
      "signature": "const needle = `${key}=\"`;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 29,
      "name": "found",
      "signature": "const found: string[] = [];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 32,
      "name": "end",
      "signature": "const end = text.indexOf(RULE_CLOSE, at);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 40,
      "name": "open",
      "signature": "const open = segment.indexOf(DESCRIPTION_OPEN);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 41,
      "name": "close",
      "signature": "const close = open === -1 ? -1 : segment.indexOf(DESCRIPTION_CLOSE, open);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 42,
      "name": "text",
      "signature": "const text = close === -1 ? \"\" : segment.slice(open + DESCRIPTION_OPEN.length, close).trim();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 47,
      "name": "tag",
      "signature": "const tag = segment.slice(0, segment.indexOf(\">\"));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 49,
      "name": "className",
      "signature": "const className = attr(tag, \"class\");"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 69,
      "name": "texts",
      "signature": "const texts = await Promise.all(RULESETS.map(async (ruleset) => remoteText(`${SOURCE_ROOT}/${ruleset}.xml`)));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 74,
      "name": "rules",
      "signature": "const rules = (await rulesets())"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 86,
      "name": "knobsOf",
      "signature": "const knobsOf = function knobsOf(segment: string): KnobEntry[] {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 87,
      "name": "name",
      "signature": "const name = segment.slice(RULE_OPEN.length, segment.indexOf('\"', RULE_OPEN.length));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 89,
      "name": "at",
      "signature": "const at = segment.indexOf(`name=\"${property}\"`);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 90,
      "name": "value",
      "signature": "const value = at === -1 ? null : intAfter(segment, 'value=\"', { from: at, window: PROPERTY_WINDOW });"
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpmd-producer-ts",
  "language": "typescript",
  "layer": "application",
  "name": "tool.phpmd.producer.ts",
  "path": "core/producers/tool.phpmd.producer.ts",
  "ref": "anatomy:file-quality-core-producers-tool-phpmd-producer-ts",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/quality#folder-quality-core-producers",
          "json": "https://banes-lab.com/json/anatomy/quality/folder-quality-core-producers",
          "label": "core/producers",
          "markdown": "https://banes-lab.com/anatomy/quality/folder-quality-core-producers.md",
          "ref": "chapter:/anatomy/quality#folder-quality-core-producers"
        }
      ],
      "relation": "contained-in"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/quality#file-quality-core-aggregators-catalog-aggregator-ts",
          "json": "https://banes-lab.com/json/source/quality/core/aggregators/catalog.aggregator.ts",
          "label": "core/aggregators/catalog.aggregator.ts",
          "markdown": "https://banes-lab.com/source/quality/core/aggregators/catalog.aggregator.ts.md",
          "ref": "anatomy:file-quality-core-aggregators-catalog-aggregator-ts"
        }
      ],
      "relation": "uses"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/quality#folder-quality-core-aggregators",
          "json": "https://banes-lab.com/json/anatomy/quality/folder-quality-core-aggregators",
          "label": "core/aggregators",
          "markdown": "https://banes-lab.com/anatomy/quality/folder-quality-core-aggregators.md",
          "ref": "chapter:/anatomy/quality#folder-quality-core-aggregators"
        },
        {
          "href": "https://banes-lab.com/anatomy/quality#folder-quality-core-producers",
          "json": "https://banes-lab.com/json/anatomy/quality/folder-quality-core-producers",
          "label": "core/producers",
          "markdown": "https://banes-lab.com/anatomy/quality/folder-quality-core-producers.md",
          "ref": "chapter:/anatomy/quality#folder-quality-core-producers"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "slots": {
    "concern": "producer",
    "subject": "tool",
    "variant": "phpmd"
  },
  "stats": {
    "bytes": 4225,
    "callable": 8,
    "definitions": 32,
    "edges": 4,
    "exported": 0,
    "files": 1,
    "findings": {},
    "flows": {
      "leaf": 3,
      "entry": 3,
      "isolated": 26
    },
    "lines": {
      "blank": 10,
      "code": 91,
      "total": 101
    }
  },
  "summary": "91 lines of code and 32 definitions.",
  "text": "https://banes-lab.com/source/quality/core/producers/tool.phpmd.producer.ts.txt",
  "tree": "quality",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-prettier-producer-ts",
      "json": "https://banes-lab.com/json/source/quality/core/producers/tool.prettier.producer.ts",
      "label": "core/producers/tool.prettier.producer.ts",
      "markdown": "https://banes-lab.com/source/quality/core/producers/tool.prettier.producer.ts.md",
      "ref": "anatomy:file-quality-core-producers-tool-prettier-producer-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/quality#file-quality-core-producers-tool-phpcs-producer-ts",
      "json": "https://banes-lab.com/json/source/quality/core/producers/tool.phpcs.producer.ts",
      "label": "core/producers/tool.phpcs.producer.ts",
      "markdown": "https://banes-lab.com/source/quality/core/producers/tool.phpcs.producer.ts.md",
      "ref": "anatomy:file-quality-core-producers-tool-phpcs-producer-ts"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/source/quality/core/producers",
    "label": "core/producers",
    "markdown": "https://banes-lab.com/api/source/quality/core/producers.md",
    "ref": "api:source/quality/core/producers"
  }
}
