engine-bay/admin-portal

View on GitHub

Showing 112 of 112 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

        <TabbedShowLayout.Tab
          label={translate("triggers")}
          path="triggerBlueprints"
        >
          <ArrayField label={false} source="triggerBlueprints">
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 200..214
EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 173..184
EngineBay.AdminPortal/AdminPortal/src/pages/workbooks/Workbooks.tsx on lines 164..175

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 145.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

        <TabbedShowLayout.Tab
          label={translate("inputDataTables")}
          path="inputDataTableBlueprints"
        >
          <ArrayField label={false} source="inputDataTableBlueprints">
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 200..214
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 231..245
EngineBay.AdminPortal/AdminPortal/src/pages/workbooks/Workbooks.tsx on lines 164..175

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 145.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

        <TabbedShowLayout.Tab label={translate("blueprints")} path="blueprints">
          <ArrayField label={false} source="blueprints">
            <Datagrid bulkActionButtons={false} optimized>
              <TextField label={translate("name")} source="name" />
              <RichTextField
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 200..214
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 231..245
EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 173..184

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 145.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

test("Variables index page should render", async () => {
  render(
    <AdminContext>
      <Resource
        name="data-variable-blueprints"
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/blueprints.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/expressions/expression.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/tables/tables.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/triggers/triggers.test.tsx on lines 6..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

test("Expressions index page should render", async () => {
  render(
    <AdminContext>
      <Resource
        name="meta-data/Expressions"
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/blueprints.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/tables/tables.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/triggers/triggers.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/variables/variables.test.tsx on lines 6..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

test("Triggers index page should render", async () => {
  render(
    <AdminContext>
      <Resource
        name="trigger-blueprints"
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/blueprints.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/expressions/expression.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/tables/tables.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/variables/variables.test.tsx on lines 6..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

test("Tables index page should render", async () => {
  render(
    <AdminContext>
      <Resource
        name="data-table-blueprints"
EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/blueprints.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/expressions/expression.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/triggers/triggers.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/variables/variables.test.tsx on lines 6..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

test("Blueprints index page should render", async () => {
  render(
    <AdminContext>
      <Resource
        name="meta-data/blueprints"
EngineBay.AdminPortal/AdminPortal/src/pages/expressions/expression.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/tables/tables.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/triggers/triggers.test.tsx on lines 6..21
EngineBay.AdminPortal/AdminPortal/src/pages/variables/variables.test.tsx on lines 6..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function StudioShow has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const StudioShow = () => {
  const translate = useTranslate();

  const [layout, setLayout] = useLocalStorage<Layout[]>(
    "studio.layout",
Severity: Major
Found in EngineBay.AdminPortal/AdminPortal/src/pages/studio/Studio.tsx - About 3 hrs to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            <TabbedShowLayout.Tab
              label={translate("outputDataVariables")}
              path="outputDataVariableBlueprint"
            >
              <TextField
    EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 185..201

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            <TabbedShowLayout.Tab
              label={translate("outputDataVariables")}
              path="outputDataVariableBlueprint"
            >
              <TextField
    EngineBay.AdminPortal/AdminPortal/src/pages/triggers/Triggers.tsx on lines 148..164

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function App has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const App = () => {
      // this sets up a basic client-side cache
      const queryClient = new QueryClient({
        defaultOptions: {
          queries: {
    Severity: Major
    Found in EngineBay.AdminPortal/AdminPortal/src/App.tsx - About 3 hrs to fix

      Function BlueprintShow has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const BlueprintShow = () => {
        const translate = useTranslate();
        return (
          <Show resource="blueprints" title={translate("blueprint")}>
            <TabbedShowLayout>
      Severity: Major
      Found in EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx - About 3 hrs to fix

        Function importBlueprints has 81 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const importBlueprints = async (file: Blob) => {
            return new Promise<Blueprint[]>((resolve) => {
                const reader = new FileReader();
                reader.readAsArrayBuffer(file)
        
        
        Severity: Major
        Found in EngineBay.AdminPortal/AdminPortal/src/lib/imports/importBlueprints.ts - About 3 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if (blueprint) {
                for (const expressionBlueprint of blueprint.expressionBlueprints) {
                  initialNodes.push({
                    id: expressionBlueprint.id || uuidv4(),
                    data: {

            Function onload has 75 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    reader.onload = () => {
                        const wb = read(reader.result);
            
                        let blueprints: Blueprint[] = [];
            
            
            Severity: Major
            Found in EngineBay.AdminPortal/AdminPortal/src/lib/imports/importBlueprints.ts - About 3 hrs to fix

              File BlueprintVisualizer.tsx has 283 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { useEffect, useState } from "react";
              import ReactFlow, {
                Background,
                Controls,
                Node,

                Function updatedTreeData has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        (blueprint: Blueprint) => {
                          const expressionBlueprintChildren =
                            blueprint.expressionBlueprints.map((expressionBlueprint) => {
                              return {
                                nodeId: expressionBlueprint.id,
                Severity: Major
                Found in EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx - About 2 hrs to fix

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          const { json } = await httpClient(url, {
                              method: 'PUT',
                              body: JSON.stringify(params.data),
                              user: {
                                  authenticated: localStorage.getItem("isAuthenticated") === "true",
                  Severity: Major
                  Found in EngineBay.AdminPortal/AdminPortal/src/lib/data-provider.ts and 1 other location - About 2 hrs to fix
                  EngineBay.AdminPortal/AdminPortal/src/lib/data-provider.ts on lines 106..113

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 83.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          const { json } = await httpClient(url, {
                              method: 'PUT',
                              body: JSON.stringify(params.data),
                              user: {
                                  authenticated: localStorage.getItem("isAuthenticated") === "true",
                  Severity: Major
                  Found in EngineBay.AdminPortal/AdminPortal/src/lib/data-provider.ts and 1 other location - About 2 hrs to fix
                  EngineBay.AdminPortal/AdminPortal/src/lib/data-provider.ts on lines 122..129

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 83.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language