bootstrapworld/codemirror-blocks

View on GitHub

Showing 132 of 132 total issues

Function checkASTRoundtripConversion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function checkASTRoundtripConversion(
oldCode: string,
language: Language
): Result<{ oldAst: AST; newAst: AST; newCode: string }, string> {
let oldAst: AST;
Severity: Minor
Found in packages/codemirror-blocks/src/state/actions.ts - About 35 mins to fix

Function computeFocusNodeFromChanges has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function computeFocusNodeFromChanges(
text: ReadonlyRangedText,
changes: EditorChange[],
newAST: AST
): ASTNode | null {
Severity: Minor
Found in packages/codemirror-blocks/src/edits/commitChanges.ts - About 35 mins to fix

Function Read Ancestors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

"Read Ancestors": (env, _) => (dispatch, getState) => {
if (!env.isNodeEnv) {
return;
}
const parents = [env.node.shortDescription()];
Severity: Minor
Found in packages/codemirror-blocks/src/keymap.tsx - About 35 mins to fix

Avoid too many return statements within this function.
Open

return null;
Severity: Major
Found in packages/codemirror-blocks/src/languages/wescheme/WeschemeParser.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    return new structures.defVar(
    parseIdExpr(sexp[1]),
    parseExpr(sexp[2]),
    sexp
    );
    Severity: Major
    Found in packages/codemirror-blocks/src/languages/wescheme/WeschemeParser.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return (function () {
      var res = new structures.quotedExpr(sexp);
      res.location = sexp.location;
      return res;
      })();
      Severity: Major
      Found in packages/wescheme-blocks/src/WeschemeParser.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return WhenUnless(
        from,
        to,
        form,
        parseNode(node.predicate),
        Severity: Major
        Found in packages/wescheme-blocks/src/parseNode.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return new CondClause(
          from,
          to,
          parseNode(node.first),
          [parseNode(node.second)],
          Severity: Major
          Found in packages/codemirror-blocks/src/languages/wescheme/WeschemeParser.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return new Token(
            { line: this.lineIndex, ch: startIndex },
            { line: this.lineIndex, ch: startIndex + number.length },
            TOKENS.NUMBER,
            number
            Severity: Major
            Found in packages/codemirror-blocks/src/languages/example/ExampleParser.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return StructDefinition(from, to, parseNode(node.name), fields, {
              ariaLabel:
              symbolAria(node.name.val) +
              ": structure definition with " +
              pluralize("field", node.fields) +
              Severity: Major
              Found in packages/wescheme-blocks/src/parseNode.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                return IfExpression(from, to, predicate, consequence, alternative, {
                ariaLabel: "if-then-else expression",
                comment: comment,
                });
                Severity: Major
                Found in packages/wescheme-blocks/src/parseNode.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                  return new LambdaExpression(from, to, args, parseNode(node.body), {
                  ariaLabel:
                  "anonymous function with " +
                  pluralize("argument", node.args) +
                  ": " +
                  Severity: Major
                  Found in packages/codemirror-blocks/src/languages/wescheme/WeschemeParser.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                    return (function () {
                    var res = new structures.quotedExpr(sexp);
                    res.location = sexp.location;
                    return res;
                    })();
                    Severity: Major
                    Found in packages/codemirror-blocks/src/languages/wescheme/WeschemeParser.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                      return new Comment(from, to, node.txt);
                      Severity: Major
                      Found in packages/codemirror-blocks/src/languages/wescheme/WeschemeParser.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                        return null;
                        Severity: Major
                        Found in packages/codemirror-blocks/src/ui/searchers/ByString.tsx - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                          if (isKw("if")) return parseIf();
                          Severity: Major
                          Found in packages/codemirror-blocks/src/languages/lambda/parser.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                            return {
                            from: fromLocation,
                            to: toLocation,
                            type: "op",
                            value: readWhite(isOpChar),
                            Severity: Major
                            Found in packages/codemirror-blocks/src/languages/lambda/parser.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                              return fallback(sexp);
                              Severity: Major
                              Found in packages/wescheme-blocks/src/WeschemeParser.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                return parseExpr(sexp);
                                Severity: Major
                                Found in packages/wescheme-blocks/src/WeschemeParser.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                  return state;
                                  Severity: Major
                                  Found in packages/codemirror-blocks/src/state/reducers.ts - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language