Showing 33 of 112 total issues
Function generateBlueprintsFromCells
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
Open
export const generateBlueprintsFromCells = (wb: SheetJSWorkbook, worksheetName: string, allCells: Cell[], cells: Cell[]) => {
const blueprints: Blueprint[] = [];
const expressionBlueprints: ExpressionBlueprint[] = [];
const dataVariableBlueprints: DataVariableBlueprint[] = [];
- 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 generateBlueprintsFromCells
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const generateBlueprintsFromCells = (wb: SheetJSWorkbook, worksheetName: string, allCells: Cell[], cells: Cell[]) => {
const blueprints: Blueprint[] = [];
const expressionBlueprints: ExpressionBlueprint[] = [];
const dataVariableBlueprints: DataVariableBlueprint[] = [];
Function importBlueprints
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
Open
export const importBlueprints = async (file: Blob) => {
return new Promise<Blueprint[]>((resolve) => {
const reader = new FileReader();
reader.readAsArrayBuffer(file)
- 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 StudioShow
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const StudioShow = () => {
const translate = useTranslate();
const [layout, setLayout] = useLocalStorage<Layout[]>(
"studio.layout",
Function App
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const App = () => {
// this sets up a basic client-side cache
const queryClient = new QueryClient({
defaultOptions: {
queries: {
Function BlueprintShow
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const BlueprintShow = () => {
const translate = useTranslate();
return (
<Show resource="blueprints" title={translate("blueprint")}>
<TabbedShowLayout>
Function importBlueprints
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const importBlueprints = async (file: Blob) => {
return new Promise<Blueprint[]>((resolve) => {
const reader = new FileReader();
reader.readAsArrayBuffer(file)
Function onload
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reader.onload = () => {
const wb = read(reader.result);
let blueprints: Blueprint[] = [];
Consider simplifying this complex logical expression. Open
Open
if (blueprint) {
for (const expressionBlueprint of blueprint.expressionBlueprints) {
initialNodes.push({
id: expressionBlueprint.id || uuidv4(),
data: {
File BlueprintVisualizer.tsx
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useEffect, useState } from "react";
import ReactFlow, {
Background,
Controls,
Node,
Function updatedTreeData
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(blueprint: Blueprint) => {
const expressionBlueprintChildren =
blueprint.expressionBlueprints.map((expressionBlueprint) => {
return {
nodeId: expressionBlueprint.id,
Function ExpressionShow
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ExpressionShow = () => {
const translate = useTranslate();
return (
<Show resource="expression-blueprints" title={translate("expression")}>
<TabbedShowLayout>
Function BlueprintList
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const BlueprintList = () => {
const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
const translate = useTranslate();
const filters = [
<TextInput
Function TriggerShow
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const TriggerShow = () => {
const translate = useTranslate();
return (
<Show resource="trigger-blueprints" title={translate("trigger")}>
<TabbedShowLayout>
Function WorkbookImport
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const WorkbookImport = () => {
const translate = useTranslate();
const [create] = useCreate();
const redirect = useRedirect();
const saveWorkbook = async (data: WorkbookImportFormData) => {
Function ExpressionList
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ExpressionList = () => {
const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
const translate = useTranslate();
const filters = [
Function VariableList
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const VariableList = () => {
const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
const translate = useTranslate();
const filters = [
Function WorkbookList
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const WorkbookList = () => {
const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
const translate = useTranslate();
const filters = [
Function TableList
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const TableList = () => {
const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
const translate = useTranslate();
const filters = [
Function TriggerList
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const TriggerList = () => {
const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
const translate = useTranslate();
const filters = [