vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Method ForEachState.Validate has 5 return statements (exceeds 4 allowed).
Open

func (o *ForEachState) Validate() error {
    if err := o.commonValidate(); err != nil {
        return err
    }

Severity: Major
Found in pkg/model/state-foreach.go - About 35 mins to fix

    Method varController.list has 5 return statements (exceeds 4 allowed).
    Open

    func (e *varController) list(w http.ResponseWriter, r *http.Request) {
        // handle raw var read.
        if r.URL.Query().Get("raw") == "true" {
            e.listRaw(w, r)
            return
    Severity: Major
    Found in pkg/api/variables.go - About 35 mins to fix

      Method ValidateState.Validate has 5 return statements (exceeds 4 allowed).
      Open

      func (o *ValidateState) Validate() error {
          if err := o.commonValidate(); err != nil {
              return err
          }
      
      
      Severity: Major
      Found in pkg/model/state-validate.go - About 35 mins to fix

        Method DelayState.Validate has 5 return statements (exceeds 4 allowed).
        Open

        func (o *DelayState) Validate() error {
            if err := o.commonValidate(); err != nil {
                return err
            }
        
        
        Severity: Major
        Found in pkg/model/state-delay.go - About 35 mins to fix

          Method varController.get has 5 return statements (exceeds 4 allowed).
          Open

          func (e *varController) get(w http.ResponseWriter, r *http.Request) {
              // handle raw var read.
              if r.URL.Query().Get("raw") == "true" {
                  e.getRaw(w, r)
                  return
          Severity: Major
          Found in pkg/api/variables.go - About 35 mins to fix

            Function ServicePage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

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

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function FileViewer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            const FileViewer = ({ file }: { file: BaseFileSchemaType }) => {
              const { t } = useTranslation();
              const theme = useTheme();
              const { data } = useFile({ path: file.path });
            
            
            Severity: Minor
            Found in ui/src/pages/namespace/Explorer/Tree/components/modals/FileViewer.tsx - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

            func (a *StateType) UnmarshalJSON(data []byte) error {
                var s string
            
                err := json.Unmarshal(data, &s)
                if err != nil {
            Severity: Major
            Found in pkg/model/enums.go and 4 other locations - About 35 mins to fix
            pkg/model/enums.go on lines 44..60
            pkg/model/enums.go on lines 123..139
            pkg/model/enums.go on lines 315..331
            pkg/model/function-common.go on lines 52..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 105.

            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

            func (a *StartType) UnmarshalJSON(data []byte) error {
                var s string
            
                err := json.Unmarshal(data, &s)
                if err != nil {
            Severity: Major
            Found in pkg/model/enums.go and 4 other locations - About 35 mins to fix
            pkg/model/enums.go on lines 44..60
            pkg/model/enums.go on lines 123..139
            pkg/model/enums.go on lines 233..249
            pkg/model/function-common.go on lines 52..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 105.

            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

            func (a *BranchMode) UnmarshalJSON(data []byte) error {
                var s string
            
                err := json.Unmarshal(data, &s)
                if err != nil {
            Severity: Major
            Found in pkg/model/enums.go and 4 other locations - About 35 mins to fix
            pkg/model/enums.go on lines 123..139
            pkg/model/enums.go on lines 233..249
            pkg/model/enums.go on lines 315..331
            pkg/model/function-common.go on lines 52..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 105.

            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

            func (a *FunctionType) UnmarshalJSON(data []byte) error {
                var s string
            
                err := json.Unmarshal(data, &s)
                if err != nil {
            Severity: Major
            Found in pkg/model/function-common.go and 4 other locations - About 35 mins to fix
            pkg/model/enums.go on lines 44..60
            pkg/model/enums.go on lines 123..139
            pkg/model/enums.go on lines 233..249
            pkg/model/enums.go on lines 315..331

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

            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 (s *sqlRuntimeVariablesStore) Delete(ctx context.Context, id uuid.UUID) error {
                res := s.db.WithContext(ctx).Exec(
                    `DELETE FROM runtime_variables WHERE id = ?`,
                    id)
                if res.Error != nil {
            Severity: Minor
            Found in pkg/datastore/datastoresql/runtime_variables.go and 1 other location - About 35 mins to fix
            pkg/datastore/datastoresql/mirror.go on lines 130..143

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

            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

            func (a *Size) UnmarshalJSON(data []byte) error {
                var s string
            
                err := json.Unmarshal(data, &s)
                if err != nil {
            Severity: Major
            Found in pkg/model/enums.go and 4 other locations - About 35 mins to fix
            pkg/model/enums.go on lines 44..60
            pkg/model/enums.go on lines 233..249
            pkg/model/enums.go on lines 315..331
            pkg/model/function-common.go on lines 52..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 105.

            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 (s sqlMirrorStore) DeleteConfig(ctx context.Context, namespace string) error {
                res := s.db.WithContext(ctx).Exec(`DELETE FROM mirror_configs WHERE namespace=?`, namespace)
                if res.Error != nil {
                    return res.Error
                }
            Severity: Minor
            Found in pkg/datastore/datastoresql/mirror.go and 1 other location - About 35 mins to fix
            pkg/datastore/datastoresql/runtime_variables.go on lines 262..277

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

            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

                  <PaginationLink
                    icon="left"
                    onClick={() =>
                      previousPage && setOffset(setOffsetByPageNumber(previousPage))
                    }
            Severity: Minor
            Found in ui/src/components/Pagination/index.tsx and 1 other location - About 35 mins to fix
            ui/src/components/Pagination/index.tsx on lines 65..70

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

            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

                        <Badge
                          variant={statusToBadgeVariant(instance.status)}
                          icon={instance.status}
                        >
                          {instance.status}
            Severity: Minor
            Found in ui/src/pages/namespace/Instances/List/Row.tsx and 1 other location - About 35 mins to fix
            ui/src/pages/namespace/Instances/Detail/Header/index.tsx on lines 57..62

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

            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

                    <div className="grow text-sm">
                      {route.server_path && <PublicPathInput path={route.server_path} />}
                    </div>
            Severity: Minor
            Found in ui/src/pages/namespace/Gateway/Routes/Detail/Header.tsx and 1 other location - About 35 mins to fix
            ui/src/pages/namespace/Gateway/Routes/Table/Row.tsx on lines 86..88

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

            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

                    onClick={() => {
                      navigate(
                        pages.instances.createHref({
                          namespace,
                          instance: instance.id,
            Severity: Minor
            Found in ui/src/pages/namespace/Monitoring/Instances/Row.tsx and 1 other location - About 35 mins to fix
            ui/src/pages/namespace/Mirror/Detail/Row/index.tsx on lines 36..43

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

            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

                          <TooltipTrigger asChild>
                            <CopyButton
                              value={logData ?? ""}
                              buttonProps={{
                                variant: "outline",
            Severity: Minor
            Found in ui/src/pages/namespace/Services/Detail/Pods/index.tsx and 1 other location - About 35 mins to fix
            ui/src/pages/namespace/Instances/Detail/Main/InputOutput/Toolbar.tsx on lines 33..42

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

            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

                        <div>
                          <CopyButton
                            value={copyText ?? ""}
                            buttonProps={{
                              variant: "outline",
            ui/src/pages/namespace/Services/Detail/Pods/index.tsx on lines 80..89

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

            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