vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Function ConsumerTable has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ConsumerTable = () => {
  const { t } = useTranslation();
  const {
    data: consumerList,
    isSuccess,
Severity: Major
Found in ui/src/pages/namespace/Gateway/Consumers/Table/index.tsx - About 2 hrs to fix

    Function ServicesListPage has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ServicesListPage = () => {
      const { t } = useTranslation();
      const {
        data: serviceList,
        isFetching,
    Severity: Major
    Found in ui/src/pages/namespace/Services/List/index.tsx - About 2 hrs to fix

      Function generateActionInput has 80 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func generateActionInput(ctx context.Context, args *generateActionInputArgs) ([]byte, []model.FunctionFileDefinition, error) {
          var err error
          var input interface{}
      
          input, err = jqObject(args.Source, "jq(.)") //nolint:contextcheck
      Severity: Major
      Found in pkg/flow/states/action-helpers.go - About 2 hrs to fix

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

          const { mutate: downloadVar } = useDownloadVar({
            onSuccess: (response) => {
              const { name: filename, data: base64String, mimeType } = response.data;
              triggerDownloadFromBase64String({
                filename,
        Severity: Major
        Found in ui/src/pages/namespace/Settings/Variables/index.tsx and 1 other location - About 2 hrs to fix
        ui/src/pages/namespace/Explorer/Workflow/Settings/Variables/index.tsx on lines 42..51

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

        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 { mutate: downloadVar } = useDownloadVar({
            onSuccess: (response) => {
              const { name: filename, data: base64String, mimeType } = response.data;
              triggerDownloadFromBase64String({
                filename,
        ui/src/pages/namespace/Settings/Variables/index.tsx on lines 56..65

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

        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

        Method LocalServer.varHandler has 79 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (srv *LocalServer) varHandler(w http.ResponseWriter, r *http.Request) {
            actionId := r.URL.Query().Get("aid")
        
            srv.requestsLock.Lock()
            req, ok := srv.requests[actionId]
        Severity: Major
        Found in cmd/sidecar/local-server.go - About 2 hrs to fix

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

          func (timers *timers) deleteTimersForInstanceNoBroadcast(name string) {
              var keys []string
          
              timers.mtx.Lock()
              defer timers.mtx.Unlock()
          Severity: Major
          Found in pkg/flow/timers.go and 1 other location - About 2 hrs to fix
          pkg/flow/timers.go on lines 261..288

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

          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

          func (timers *timers) deleteTimersForActivityNoBroadcast(name string) {
              var keys []string
          
              timers.mtx.Lock()
              defer timers.mtx.Unlock()
          Severity: Major
          Found in pkg/flow/timers.go and 1 other location - About 2 hrs to fix
          pkg/flow/timers.go on lines 232..259

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

          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

                  <fieldset className="flex items-center gap-5">
                    <label className="w-[150px] text-right" htmlFor="url">
                      {t("pages.settings.registries.create.url")}
                    </label>
                    <Input
          Severity: Major
          Found in ui/src/pages/namespace/Settings/Registries/Create/index.tsx and 1 other location - About 2 hrs to fix
          ui/src/pages/namespace/Settings/Registries/Create/index.tsx on lines 65..75

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

          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

                    <DialogTrigger
                      className="w-full"
                      data-testid="new-workflow"
                      onClick={() => {
                        setSelectedDialog("new-workflow");
          ui/src/pages/namespace/Explorer/Tree/components/NewFileButton.tsx on lines 57..68

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

          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

                  <fieldset className="flex items-center gap-5">
                    <label className="w-[150px] text-right" htmlFor="user">
                      {t("pages.settings.registries.create.user")}
                    </label>
                    <Input
          Severity: Major
          Found in ui/src/pages/namespace/Settings/Registries/Create/index.tsx and 1 other location - About 2 hrs to fix
          ui/src/pages/namespace/Settings/Registries/Create/index.tsx on lines 54..64

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

          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

                  <DialogTrigger
                    className="w-full"
                    data-testid="new-dir"
                    onClick={() => {
                      setSelectedDialog("new-dir");
          ui/src/pages/namespace/Explorer/Tree/components/NewFileButton.tsx on lines 71..82

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

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

          const NamespaceSelector = () => {
            const pages = usePages();
            const { t } = useTranslation();
            const namespace = useNamespace();
          
          
          Severity: Major
          Found in ui/src/components/Breadcrumb/NamespaceSelector.tsx - About 2 hrs to fix

            Function NoMirror has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const NoMirror = () => {
              const { t } = useTranslation();
            
              const docsUrl = "https://docs.direktiv.io/environment/git/";
              const examplesUrl = "https://github.com/direktiv/direktiv-examples";
            Severity: Major
            Found in ui/src/pages/namespace/Mirror/NoMirror/index.tsx - About 2 hrs to fix

              Function ServicePage has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const ServicePage: FC = () => {
                const pages = usePages();
                const { path } = pages.explorer.useParams();
                const namespace = useNamespace();
                const { segments } = analyzePath(path);
              Severity: Major
              Found in ui/src/pages/namespace/Explorer/Service/index.tsx - About 2 hrs to fix

                File index.tsx has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import {
                  BookOpen,
                  FileInput,
                  FileOutput,
                  Play,
                Severity: Minor
                Found in ui/src/pages/namespace/JqPlayground/index.tsx - About 2 hrs to fix

                  Function Logs has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const Logs = () => {
                    const { t } = useTranslation();
                  
                    const {
                      data: logLines = [],
                  Severity: Major
                  Found in ui/src/pages/namespace/Monitoring/Logs/index.tsx - About 2 hrs to fix

                    Function ListenersList has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const ListenersList = () => {
                      const [offset, setOffset] = useState(0);
                      const { data, isFetched, isAllowed, noPermissionMessage } = useEventListeners(
                        { limit: pageSize, offset }
                      );
                    Severity: Major
                    Found in ui/src/pages/namespace/Events/Listeners/index.tsx - About 2 hrs to fix

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

                      const fetchTokens = async ({
                        queryKey: [{ apiKey, namespace }],
                      }: QueryFunctionContext<ReturnType<(typeof tokenKeys)["tokenList"]>>) =>
                        getTokens({
                          apiKey,
                      Severity: Major
                      Found in ui/src/api/enterprise/tokens/query/get.ts and 8 other locations - About 2 hrs to fix
                      ui/src/api/enterprise/groups/query/get.ts on lines 16..22
                      ui/src/api/enterprise/policy/query/get.ts on lines 16..24
                      ui/src/api/gateway/query/getConsumers.ts on lines 16..22
                      ui/src/api/gateway/query/getRoutes.ts on lines 18..24
                      ui/src/api/notifications/query/get.ts on lines 16..24
                      ui/src/api/registries/query/get.ts on lines 16..24
                      ui/src/api/secrets/query/get.ts on lines 20..26
                      ui/src/api/syncs/query/get.ts on lines 17..23

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

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

                      const fetchSyncs = async ({
                        queryKey: [{ apiKey, namespace }],
                      }: QueryFunctionContext<ReturnType<(typeof syncKeys)["syncsList"]>>) =>
                        getSyncs({
                          apiKey,
                      Severity: Major
                      Found in ui/src/api/syncs/query/get.ts and 8 other locations - About 2 hrs to fix
                      ui/src/api/enterprise/groups/query/get.ts on lines 16..22
                      ui/src/api/enterprise/policy/query/get.ts on lines 16..24
                      ui/src/api/enterprise/tokens/query/get.ts on lines 16..22
                      ui/src/api/gateway/query/getConsumers.ts on lines 16..22
                      ui/src/api/gateway/query/getRoutes.ts on lines 18..24
                      ui/src/api/notifications/query/get.ts on lines 16..24
                      ui/src/api/registries/query/get.ts on lines 16..24
                      ui/src/api/secrets/query/get.ts on lines 20..26

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

                      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