engine-bay/admin-portal

View on GitHub

Showing 112 of 112 total issues

Function ExpressionShow has 60 lines of code (exceeds 25 allowed). Consider refactoring.
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

    export const BlueprintList = () => {
      const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
      const translate = useTranslate();
      const filters = [
        <TextInput
    Severity: Major
    Found in EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx - About 2 hrs to fix

      Function TriggerShow has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function WorkbookImport has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const WorkbookImport = () => {
          const translate = useTranslate();
          const [create] = useCreate();
          const redirect = useRedirect();
          const saveWorkbook = async (data: WorkbookImportFormData) => {
        Severity: Major
        Found in EngineBay.AdminPortal/AdminPortal/src/pages/workbooks/Workbooks.tsx - About 2 hrs to fix

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

          const OutputDataVariableBlueprintsCount = () => {
            const record = useRecordContext();
            if (!record) return null;
            return (
              <Count
          EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 32..40

          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 76.

          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 2 locations. Consider refactoring.
          Open

          const InputDataVariableBlueprintsCount = () => {
            const record = useRecordContext();
            if (!record) return null;
            return (
              <Count
          EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 42..50

          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 76.

          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 ExpressionList has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const ExpressionList = () => {
            const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
            const translate = useTranslate();
          
            const filters = [

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

                    for (const dataVariableBlueprint of blueprint.dataVariableBlueprints) {
                      blueprintIdDictionary[dataVariableBlueprint.id] = blueprint.id;
                      elementIdDictionary[dataVariableBlueprint.id] =
                        dataVariableBlueprint.id;
                      elementTypeDictionary[dataVariableBlueprint.id] =
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 140..145
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 146..150
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 158..162

            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 74.

            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

                    for (const dataTableBlueprint of blueprint.dataTableBlueprints) {
                      blueprintIdDictionary[dataTableBlueprint.id] = blueprint.id;
                      elementIdDictionary[dataTableBlueprint.id] = dataTableBlueprint.id;
                      elementTypeDictionary[dataTableBlueprint.id] = ElementType.DataTable;
                    }
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 140..145
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 151..157
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 158..162

            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 74.

            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

                    for (const triggerBlueprint of blueprint.triggerBlueprints) {
                      blueprintIdDictionary[triggerBlueprint.id] = blueprint.id;
                      elementIdDictionary[triggerBlueprint.id] = triggerBlueprint.id;
                      elementTypeDictionary[triggerBlueprint.id] = ElementType.Trigger;
                    }
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 140..145
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 146..150
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 151..157

            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 74.

            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

                    for (const expressionBlueprint of blueprint.expressionBlueprints) {
                      blueprintIdDictionary[expressionBlueprint.id] = blueprint.id;
                      elementIdDictionary[expressionBlueprint.id] = expressionBlueprint.id;
                      elementTypeDictionary[expressionBlueprint.id] =
                        ElementType.Expression;
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 146..150
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 151..157
            EngineBay.AdminPortal/AdminPortal/src/pages/studio/WorkbookTree.tsx on lines 158..162

            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 74.

            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 WorkbookList has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const WorkbookList = () => {
              const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
              const translate = useTranslate();
            
              const filters = [
            Severity: Minor
            Found in EngineBay.AdminPortal/AdminPortal/src/pages/workbooks/Workbooks.tsx - About 1 hr to fix

              Function VariableList has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const VariableList = () => {
                const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
                const translate = useTranslate();
              
                const filters = [
              Severity: Minor
              Found in EngineBay.AdminPortal/AdminPortal/src/pages/variables/Variables.tsx - About 1 hr to fix

                Function TableList has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const TableList = () => {
                  const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
                  const translate = useTranslate();
                
                  const filters = [
                Severity: Minor
                Found in EngineBay.AdminPortal/AdminPortal/src/pages/tables/Tables.tsx - About 1 hr to fix

                  Function TriggerList has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const TriggerList = () => {
                    const isSmall = useMediaQuery<Theme>((theme) => theme.breakpoints.down("sm"));
                    const translate = useTranslate();
                  
                    const filters = [
                  Severity: Minor
                  Found in EngineBay.AdminPortal/AdminPortal/src/pages/triggers/Triggers.tsx - About 1 hr to fix

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

                            initialNodes.push({
                              id: dataTableBlueprint.id || uuidv4(),
                              data: {
                                label: dataTableBlueprint.name,
                                type: ElementType.DataTable,
                    EngineBay.AdminPortal/AdminPortal/src/pages/studio/BlueprintVisualizer.tsx on lines 155..162

                    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 70.

                    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 2 locations. Consider refactoring.
                    Open

                            initialNodes.push({
                              id: triggerBlueprint.id || uuidv4(),
                              data: {
                                label: triggerBlueprint.name,
                                type: ElementType.Trigger,
                    EngineBay.AdminPortal/AdminPortal/src/pages/studio/BlueprintVisualizer.tsx on lines 204..211

                    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 70.

                    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

                    const ExpressionBlueprintsCount = () => {
                      const record = useRecordContext();
                      if (!record) return null;
                      return (
                        <Count
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 42..50
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 52..60
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 62..70
                    EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 52..60

                    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 68.

                    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

                    const DataVariableBlueprintsCount = () => {
                      const record = useRecordContext();
                      if (!record) return null;
                      return (
                        <Count
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 32..40
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 52..60
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 62..70
                    EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 52..60

                    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 68.

                    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

                    const DataTableBlueprintsCount = () => {
                      const record = useRecordContext();
                      if (!record) return null;
                      return (
                        <Count
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 32..40
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 42..50
                    EngineBay.AdminPortal/AdminPortal/src/pages/blueprints/Blueprints.tsx on lines 62..70
                    EngineBay.AdminPortal/AdminPortal/src/pages/expressions/Expressions.tsx on lines 52..60

                    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 68.

                    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