vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

const updateInstance = apiFactory<InstanceCancelPayloadType>({
  url: ({
    baseUrl,
    namespace,
    instanceId,
Severity: Major
Found in ui/src/api/instances/mutate/cancel.ts and 2 other locations - About 3 hrs to fix
ui/src/api/enterprise/groups/mutation/edit.ts on lines 12..24
ui/src/api/variables/mutate/update.ts on lines 15..27

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

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

const TokensPage = () => {
  const { t } = useTranslation();
  const { data, isFetched, isAllowed, noPermissionMessage } = useTokens();
  const noResults = isFetched && data?.tokens.length === 0;
  const [dialogOpen, setDialogOpen] = useState(false);
Severity: Major
Found in ui/src/pages/namespace/Permissions/Tokens/index.tsx - About 3 hrs to fix

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

    export function ZoomPanDiagram(props: ZoomPanDiagramProps) {
      const { elements, disabled, orientation } = props;
      const { fitView, zoomIn, zoomOut } = useReactFlow();
      const [showMinimap, setShowMinimap] = useState(true);
      const nodesInitialized = useNodesInitialized();
    Severity: Major
    Found in ui/src/design/WorkflowDiagram/ZoomPanDiagram.tsx - About 3 hrs to fix

      Method forEachLogic.processActionResults has 105 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (logic *forEachLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
          var err error
      
          var found bool
          var idx int
      Severity: Major
      Found in pkg/flow/states/foreach.go - About 3 hrs to fix

        File temporary.go has 550 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        package flow
        
        import (
            "context"
            "encoding/json"
        Severity: Minor
        Found in pkg/flow/temporary.go - About 3 hrs to fix

          Method instController.list has 105 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (e *instController) list(w http.ResponseWriter, r *http.Request) {
              ctx := r.Context()
              ns := extractContextNamespace(r)
          
              pagination, err := e.getPagination(r)
          Severity: Major
          Found in pkg/api/instances.go - About 3 hrs to fix

            Method nsController.update has 105 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (e *nsController) update(w http.ResponseWriter, r *http.Request) {
                name := chi.URLParam(r, "name")
            
                db, err := e.db.BeginTx(r.Context())
                if err != nil {
            Severity: Major
            Found in pkg/api/namespaces.go - About 3 hrs to fix

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

              test("Consumer list is empty by default", async ({ page }) => {
                await page.goto(`/n/${namespace}/gateway/consumers`, {
                  waitUntil: "networkidle",
                });
              
              
              Severity: Major
              Found in ui/e2e/gateway/consumers/index.spec.ts and 2 other locations - About 3 hrs to fix
              ui/e2e/gateway/routes/list/index.spec.ts on lines 23..37
              ui/e2e/services/list.spec.ts on lines 25..39

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

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

              test("Route list is empty by default", async ({ page }) => {
                await page.goto(`/n/${namespace}/gateway/routes`, {
                  waitUntil: "networkidle",
                });
              
              
              Severity: Major
              Found in ui/e2e/gateway/routes/list/index.spec.ts and 2 other locations - About 3 hrs to fix
              ui/e2e/gateway/consumers/index.spec.ts on lines 21..35
              ui/e2e/services/list.spec.ts on lines 25..39

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

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

              test("Service list is empty by default", async ({ page }) => {
                await page.goto(`/n/${namespace}/services`, {
                  waitUntil: "networkidle",
                });
              
              
              Severity: Major
              Found in ui/e2e/services/list.spec.ts and 2 other locations - About 3 hrs to fix
              ui/e2e/gateway/consumers/index.spec.ts on lines 21..35
              ui/e2e/gateway/routes/list/index.spec.ts on lines 23..37

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

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

              const Header = () => {
                const pages = usePages();
                const namespace = useNamespace();
                const { routePath } = pages.gateway.useParams();
                const { data: route } = useRoute({
              Severity: Major
              Found in ui/src/pages/namespace/Gateway/Routes/Detail/Header.tsx - About 3 hrs to fix

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

                const CommandList = React.forwardRef<
                  React.ElementRef<typeof CommandPrimitive.List>,
                  React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
                >(({ className, ...props }, ref) => (
                  <CommandPrimitive.List
                Severity: Major
                Found in ui/src/design/Command/index.tsx and 6 other locations - About 3 hrs to fix
                ui/src/design/Command/index.tsx on lines 105..114
                ui/src/design/ContextMenu/index.tsx on lines 167..179
                ui/src/design/Dialog/index.tsx on lines 93..105
                ui/src/design/Drawer/index.tsx on lines 100..112
                ui/src/design/Drawer/index.tsx on lines 115..124
                ui/src/design/Dropdown/index.tsx on lines 171..183

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

                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

                const DrawerOverlay = React.forwardRef<
                  React.ElementRef<typeof DrawerPrimitive.Overlay>,
                  React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
                >(({ className, ...props }, ref) => (
                  <DrawerPrimitive.Overlay
                Severity: Major
                Found in ui/src/design/Drawer/index.tsx and 3 other locations - About 3 hrs to fix
                ui/src/design/Dialog/index.tsx on lines 25..37
                ui/src/design/RadioGroup/index.tsx on lines 7..16
                ui/src/design/Tabs/index.tsx on lines 54..63

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

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

                const ContextMenuSeparator = React.forwardRef<
                  React.ElementRef<typeof ContextMenuPrimitive.Separator>,
                  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
                >(({ className, ...props }, ref) => (
                  <ContextMenuPrimitive.Separator
                Severity: Major
                Found in ui/src/design/ContextMenu/index.tsx and 6 other locations - About 3 hrs to fix
                ui/src/design/Command/index.tsx on lines 58..70
                ui/src/design/Command/index.tsx on lines 105..114
                ui/src/design/Dialog/index.tsx on lines 93..105
                ui/src/design/Drawer/index.tsx on lines 100..112
                ui/src/design/Drawer/index.tsx on lines 115..124
                ui/src/design/Dropdown/index.tsx on lines 171..183

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

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

                const DrawerDescription = React.forwardRef<
                  React.ElementRef<typeof DrawerPrimitive.Description>,
                  React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
                >(({ className, ...props }, ref) => (
                  <DrawerPrimitive.Description
                Severity: Major
                Found in ui/src/design/Drawer/index.tsx and 6 other locations - About 3 hrs to fix
                ui/src/design/Command/index.tsx on lines 58..70
                ui/src/design/Command/index.tsx on lines 105..114
                ui/src/design/ContextMenu/index.tsx on lines 167..179
                ui/src/design/Dialog/index.tsx on lines 93..105
                ui/src/design/Drawer/index.tsx on lines 100..112
                ui/src/design/Dropdown/index.tsx on lines 171..183

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

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

                const CommandSeparator = React.forwardRef<
                  React.ElementRef<typeof CommandPrimitive.Separator>,
                  React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
                >(({ className, ...props }, ref) => (
                  <CommandPrimitive.Separator
                Severity: Major
                Found in ui/src/design/Command/index.tsx and 6 other locations - About 3 hrs to fix
                ui/src/design/Command/index.tsx on lines 58..70
                ui/src/design/ContextMenu/index.tsx on lines 167..179
                ui/src/design/Dialog/index.tsx on lines 93..105
                ui/src/design/Drawer/index.tsx on lines 100..112
                ui/src/design/Drawer/index.tsx on lines 115..124
                ui/src/design/Dropdown/index.tsx on lines 171..183

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

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

                const DialogTitle = React.forwardRef<
                  React.ElementRef<typeof DialogPrimitive.Title>,
                  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
                >(({ className, ...props }, ref) => (
                  <DialogPrimitive.Title
                Severity: Major
                Found in ui/src/design/Dialog/index.tsx and 6 other locations - About 3 hrs to fix
                ui/src/design/Command/index.tsx on lines 58..70
                ui/src/design/Command/index.tsx on lines 105..114
                ui/src/design/ContextMenu/index.tsx on lines 167..179
                ui/src/design/Drawer/index.tsx on lines 100..112
                ui/src/design/Drawer/index.tsx on lines 115..124
                ui/src/design/Dropdown/index.tsx on lines 171..183

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

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

                const DropdownMenuSeparator = React.forwardRef<
                  React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
                  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
                >(({ className, ...props }, ref) => (
                  <DropdownMenuPrimitive.Separator
                Severity: Major
                Found in ui/src/design/Dropdown/index.tsx and 6 other locations - About 3 hrs to fix
                ui/src/design/Command/index.tsx on lines 58..70
                ui/src/design/Command/index.tsx on lines 105..114
                ui/src/design/ContextMenu/index.tsx on lines 167..179
                ui/src/design/Dialog/index.tsx on lines 93..105
                ui/src/design/Drawer/index.tsx on lines 100..112
                ui/src/design/Drawer/index.tsx on lines 115..124

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

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

                const DrawerTitle = React.forwardRef<
                  React.ElementRef<typeof DrawerPrimitive.Title>,
                  React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
                >(({ className, ...props }, ref) => (
                  <DrawerPrimitive.Title
                Severity: Major
                Found in ui/src/design/Drawer/index.tsx and 6 other locations - About 3 hrs to fix
                ui/src/design/Command/index.tsx on lines 58..70
                ui/src/design/Command/index.tsx on lines 105..114
                ui/src/design/ContextMenu/index.tsx on lines 167..179
                ui/src/design/Dialog/index.tsx on lines 93..105
                ui/src/design/Drawer/index.tsx on lines 115..124
                ui/src/design/Dropdown/index.tsx on lines 171..183

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

                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

                const TabsContent = React.forwardRef<
                  React.ElementRef<typeof TabsPrimitive.Content>,
                  React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
                >(({ className, ...props }, ref) => (
                  <TabsPrimitive.Content
                Severity: Major
                Found in ui/src/design/Tabs/index.tsx and 3 other locations - About 3 hrs to fix
                ui/src/design/Dialog/index.tsx on lines 25..37
                ui/src/design/Drawer/index.tsx on lines 35..47
                ui/src/design/RadioGroup/index.tsx on lines 7..16

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

                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