vorteil/direktiv

View on GitHub

Showing 467 of 1,322 total issues

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 SubflowFunctionDefinition.Validate has 5 return statements (exceeds 4 allowed).
      Open

      func (o *SubflowFunctionDefinition) Validate() error {
          if o == nil {
              return nil
          }
      
      
      Severity: Major
      Found in pkg/model/function-subflow.go - About 35 mins to fix

        Method BasicAuthPlugin.Execute has 5 return statements (exceeds 4 allowed).
        Open

        func (ba *BasicAuthPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
            // check request is already authenticated
            if gateway2.ExtractContextActiveConsumer(r) != nil {
                return r
            }
        Severity: Major
        Found in pkg/refactor/gateway2/plugins/auth/basic-auth.go - About 35 mins to fix

          Method sqlEventListenerStore.Get has 5 return statements (exceeds 4 allowed).
          Open

          func (s *sqlEventListenerStore) Get(ctx context.Context, namespace uuid.UUID, limit int, offset int) ([]*datastore.EventListener, int, error) {
              q := `SELECT 
              id, namespace_id, namespace, created_at, updated_at, deleted, received_events, trigger_type, events_lifespan, event_types, trigger_info, metadata, event_context_filters
              FROM event_listeners WHERE namespace_id = $1 `
              q += " ORDER BY created_at DESC "
          Severity: Major
          Found in pkg/refactor/datastore/datastoresql/eventstore_listener.go - About 35 mins to fix

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

            func (o *RetryDefinition) Validate() error {
                if o == nil {
                    return nil
                }
            
            
            Severity: Major
            Found in pkg/model/state-common.go - About 35 mins to fix

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

              func (o *ActionDefinition) Validate() error {
                  if o == nil {
                      return nil
                  }
              
              
              Severity: Major
              Found in pkg/model/common-structures.go - About 35 mins to fix

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

                const Header = ({ serviceId }: { serviceId: string }) => {
                  const { data: service, refetch, isFetching } = useService(serviceId);
                
                  const { t } = useTranslation();
                
                
                Severity: Minor
                Found in ui/src/pages/namespace/Services/Detail/Header.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

                Method fsController.delete has 5 return statements (exceeds 4 allowed).
                Open

                func (e *fsController) delete(w http.ResponseWriter, r *http.Request) {
                    ns := extractContextNamespace(r)
                
                    db, err := e.db.BeginTx(r.Context())
                    if err != nil {
                Severity: Major
                Found in pkg/refactor/api/filesystem.go - About 35 mins to fix

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

                  }> = ({ service, setRebuildService }) => {
                    const namespace = useNamespace();
                    const navigate = useNavigate();
                    const { t } = useTranslation();
                  
                  
                  Severity: Minor
                  Found in ui/src/pages/namespace/Services/List/Row/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 Authdialog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const Authdialog = () => {
                    const { t } = useTranslation();
                    const [showKey, setShowKey] = useState(false);
                    const { setApiKey: storeApiKey } = useApiActions();
                    const apiKeyFromLocalStorage = useApiKey();
                  Severity: Minor
                  Found in ui/src/components/Authdialog/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 ExplorerPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const ExplorerPage: FC = () => {
                    const namespace = useNamespace();
                    const { path } = pages.explorer.useParams();
                    const { data, isSuccess, isFetched, isAllowed, noPermissionMessage } =
                      useFile({
                  Severity: Minor
                  Found in ui/src/pages/namespace/Explorer/Tree/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 createHref has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      createHref: (params) => {
                        let path = "";
                        if (params.path) {
                          path = params.path.startsWith("/") ? params.path : `/${params.path}`;
                        }
                  Severity: Minor
                  Found in ui/src/util/router/pages.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 ServicePage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const ServicePage: FC = () => {
                    const { path } = pages.explorer.useParams();
                    const namespace = useNamespace();
                    const { segments } = analyzePath(path);
                    const filename = segments[segments.length - 1];
                  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

                  Method secretsController.update has 5 return statements (exceeds 4 allowed).
                  Open

                  func (e *secretsController) update(w http.ResponseWriter, r *http.Request) {
                      ns := extractContextNamespace(r)
                      secretName := chi.URLParam(r, "secretName")
                  
                      db, err := e.db.BeginTx(r.Context())
                  Severity: Major
                  Found in pkg/refactor/api/secrets.go - About 35 mins to fix

                    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

                    Method instController.getPagination has 5 return statements (exceeds 4 allowed).
                    Open

                    func (e *instController) getPagination(r *http.Request) (*paginationOptions, error) {
                        opts := new(paginationOptions)
                    
                        x := r.URL.Query().Get("limit")
                        if x != "" {
                    Severity: Major
                    Found in pkg/refactor/api/instances.go - About 35 mins to fix

                      Method secretsController.create has 5 return statements (exceeds 4 allowed).
                      Open

                      func (e *secretsController) create(w http.ResponseWriter, r *http.Request) {
                          ns := extractContextNamespace(r)
                      
                          db, err := e.db.BeginTx(r.Context())
                          if err != nil {
                      Severity: Major
                      Found in pkg/refactor/api/secrets.go - About 35 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return (
                            <>
                              <div className="border-b border-gray-5 bg-gray-1 p-5 dark:border-gray-dark-5 dark:bg-gray-dark-1">
                                <div className="flex flex-col gap-5 max-sm:space-y-4 sm:flex-row sm:items-center sm:justify-between">
                                  <h3 className="flex items-center gap-x-2 font-bold text-primary-500">
                        Severity: Major
                        Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            if (!isRouteListFetched) return null;
                          Severity: Major
                          Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language