cognitive-complexity-ts
Version:
This program analyses TypeScript and JavaScript code according to the [Cognitive Complexity metric](https://www.sonarsource.com/docs/CognitiveComplexity.pdf).
30 lines • 993 B
JavaScript
import { StickyTitle } from "../text/StickyTitle.js";
import { ToggleableBox } from "../box/ToggleableBox.js";
import { Score } from "../text/Score.js";
import { CopyText } from "../controls/CopyText.js";
import { concatFilePath } from "../../domain/path.js";
export class File {
constructor(path, name, score, children) {
this.children = children;
const fullPath = concatFilePath(path, name);
this.box = new ToggleableBox([
StickyTitle([
name,
CopyText(fullPath),
]),
Score(score),
], false);
this.box.changeHideableContent(() => this.children.map(child => child.dom));
}
get dom() {
return this.box.dom;
}
setChildren(children) {
this.children = children;
this.box.changeHideableContent(() => this.children.map(child => child.dom));
}
setOpenness(open) {
this.box.setOpenness(open);
}
}
//# sourceMappingURL=File.js.map