UNPKG

cognitive-complexity-ts

Version:

This program analyses TypeScript and JavaScript code according to the [Cognitive Complexity metric](https://www.sonarsource.com/docs/CognitiveComplexity.pdf). It produces a JSON summary and a GUI for exploring the complexity of your codebase.

23 lines 606 B
import { Main } from "./component/Main.js"; main(); async function main() { const result = await fetch("/json"); try { var ccJson = await result.text(); } catch (e) { alert("Could not fetch json by url."); return; } try { var ccResult = JSON.parse(ccJson); } catch (e) { alert("Could not parse the Cognitive Complexity result json. Check the console for details."); console.log("Could not parse:"); console.log(ccJson); return; } document.body.append(Main(ccResult)); } //# sourceMappingURL=main.js.map