propero-oss/typescript-transform-vue-templates

View on GitHub

Showing 3 of 3 total issues

Function babelTranspileWith has a Cognitive Complexity of 34 (exceeds 10 allowed). Consider refactoring.
Open

export const babelTranspileWith = () => {
  function shouldSimpleReplace(it: NodePath<t.Identifier>) {
    const name = it.node.name;
    if (t.isAssignmentExpression(it.parent) && it.key === "left") return true;
    return /^[$_]/g.test(name) && !["$event", "$$v"].includes(name);
Severity: Minor
Found in src/babel-transpile-with.ts - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function babelTranspileWith has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const babelTranspileWith = () => {
  function shouldSimpleReplace(it: NodePath<t.Identifier>) {
    const name = it.node.name;
    if (t.isAssignmentExpression(it.parent) && it.key === "left") return true;
    return /^[$_]/g.test(name) && !["$event", "$$v"].includes(name);
Severity: Major
Found in src/babel-transpile-with.ts - About 2 hrs to fix

    marked Regular Expression Denial of Service
    Open

        "marked": {
          "version": "0.8.0",
          "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.0.tgz",
          "integrity": "sha512-MyUe+T/Pw4TZufHkzAfDj6HarCBWia2y27/bhuYkTaiUnfDYFnCP3KUN+9oM7Wi6JA2rymtVYbQu3spE0GCmxQ==",
          "dev": true
    Severity: Minor
    Found in package-lock.json by nodesecurity

    Regular Expression Denial of Service

    Overview:

    The marked module is vulnerable to a regular expression denial of service. Based on the information published in the public issue, 1k characters can block for around 6 seconds.

    Recommendation:

    Consider another markdown parser until the issue can be addressed.

    Severity
    Category
    Status
    Source
    Language