Showing 132 of 132 total issues
Function parse
has a Cognitive Complexity of 245 (exceeds 5 allowed). Consider refactoring. Open
export function parse(code) {
function fallback(sexp) {
var elts =
sexp instanceof Array ? parseStar(sexp) : [parseExprSingleton(sexp)];
var guess = new structures.unsupportedExpr(elts, "Parse error");
- Read upRead up
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 parse
has a Cognitive Complexity of 242 (exceeds 5 allowed). Consider refactoring. Open
parse(code) {
function fallback(sexp) {
var elts =
sexp instanceof Array ? parseStar(sexp) : [parseExprSingleton(sexp)];
var guess = new structures.unsupportedExpr(elts, "Parse error");
- Read upRead up
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 parseNode
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
export function parseNode(node: structures.Program, i = 0) {
function locationFromNode(node: structures.Program) {
const from = {
line: node.location.startRow - 1,
ch: node.location.startCol,
- Read upRead up
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 parseNode
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
function parseNode(node, i) {
function locationFromNode(node) {
var from = {
line: node.location.startRow - 1,
ch: node.location.startCol,
- Read upRead up
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 parse
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
function parse(input) {
var fromLocation, toLocation;
var PRECEDENCE = {
"=": 1,
"||": 2,
- Read upRead up
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 Node
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
const Node = ({ expandable = true, ...props }: Props) => {
const isCollapsed = useSelector((state: RootState) =>
selectors.isCollapsed(state, props.node)
);
const isSelected = useSelector((state: RootState) =>
- Read upRead up
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 BlockEditor
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
const BlockEditor = ({ options = {}, ...props }: BlockEditorProps) => {
const { language } = props;
const dispatch: AppDispatch = useDispatch();
const ast = useSelector(selectors.getAST);
const quarantine = useSelector(selectors.getQuarantine);
- Read upRead up
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 buildBlockModeAPI
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
const buildBlockModeAPI = (
codemirror: CodeMirror.Editor,
store: AppStore,
language: Language
): BlockModeAPI => {
- Read upRead up
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 tokenStream
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
function tokenStream(input) {
var current = null;
var fromLocation = input.inputPos(),
toLocation = input.inputPos();
var keywords = " let if then else lambda λ true false js:raw ";
- Read upRead up
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 getLocation
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const getLocation = ({
ast,
id,
context,
}: {
- Read upRead up
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 patchAst
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export default function patchAst(oldTree: ASTNode[], newTree: ASTNode[]) {
function children(node: ASTNode | ASTNode[]): ASTNode[] {
if (node instanceof ASTNode) {
return [...node.children()];
}
- Read upRead up
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 search
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
search: (cur, settings, editor, state, forward) => {
const ast = selectors.getAST(state);
const { collapsedList } = state;
const collapsedNodeList = collapsedList.map(ast.getNodeById);
- Read upRead up
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 getToken
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
getToken(): Token {
const IDENTIFIER_RE = /[\w-+/*]/;
if (this.charIndex >= this.code.length) {
return new Token(
{ line: this.lineIndex, ch: this.colIndex },
- Read upRead up
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 DragAndDropEditor
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const DragAndDropEditor = (props: Props) => {
const editorRef = useRef<CodeMirrorFacade>();
const dispatch = useDispatch();
const [_, connectDropTarget] = useDrop({
accept: ItemTypes.NODE,
- Read upRead up
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 findAdjacentDropTargetId
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function findAdjacentDropTargetId(
ast: AST,
child: ASTNode,
onLeft: boolean
) {
- Read upRead up
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 pasteHandler
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
(env: Env, e: React.KeyboardEvent): AppThunk =>
(dispatch, getState) => {
if (!env.isNodeEnv) {
return;
}
- Read upRead up
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 constructor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
constructor(parent: ASTNode, child: ASTNode) {
this.parent = parent;
this.child = child;
for (const spec of parent.spec.childSpecs) {
if (spec instanceof List) {
- Read upRead up
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 groupEditsByAncestor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function groupEditsByAncestor(edits: AstEdit[]) {
const editToEditGroup: Map<AstEdit, EditGroup> = new Map();
// Group n AstEdits into m EditGroups (m <= n)
for (const edit of edits) {
// Start with the default assumption that this parent is independent.
- Read upRead up
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 PrimitiveList
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
>((props: PrimitiveListProps, ref) => {
const {
primitives = [],
selected,
setSelectedPrimitive,
- Read upRead up
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 Toggle Selection
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
"Toggle Selection": (env, e) => (dispatch, getState) => {
if (!env.isNodeEnv) {
return;
}
e.preventDefault();
- Read upRead up
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"