vorteil/direktiv

View on GitHub

Showing 407 of 1,235 total issues

Function buildResourceLimits has 53 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func buildResourceLimits(cf *core.Config, sv *core.ServiceFileData) (*corev1.ResourceRequirements, error) {
    var (
        m int
        c string
        d int
Severity: Minor
Found in pkg/service/helper.go - About 1 hr to fix

    Function MenuButton has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const MenuButton = forwardRef<ElementRef<typeof Button>>((props, ref) => {
      const { usesAccounts } = useApiKeyHandling();
      return usesAccounts ? (
        <Button
          ref={ref}
    Severity: Minor
    Found in ui/src/components/UserMenu/MenuButton/index.tsx - About 1 hr to fix

      Function DeleteNamespace has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const DeleteNamespace: FC = () => {
        const { t } = useTranslation();
        const [dialogOpen, setDialogOpen] = useState(false);
      
        return (
      Severity: Minor
      Found in ui/src/pages/namespace/Settings/DeleteNamespace/index.tsx - About 1 hr to fix

        Function App has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const App = () => {
          const theme = useTheme();
        
          const { setSystemTheme } = useThemeActions();
        
        
        Severity: Minor
        Found in ui/src/App.tsx - About 1 hr to fix

          Method engine.getInstanceMemory has 11 return statements (exceeds 4 allowed).
          Open

          func (engine *engine) getInstanceMemory(ctx context.Context, id uuid.UUID) (*instanceMemory, error) {
              tx, err := engine.flow.beginSQLTx(ctx, &sql.TxOptions{
                  Isolation: sql.LevelSerializable,
              })
              if err != nil {
          Severity: Major
          Found in pkg/flow/memory.go - About 1 hr to fix

            Method DirektivApplyer.apply has 11 return statements (exceeds 4 allowed).
            Open

            func (o *DirektivApplyer) apply(ctx context.Context, callbacks Callbacks, proc *datastore.MirrorProcess, parser *Parser, notes map[string]string) error {
                o.log = newPIDFormatLogger(callbacks.ProcessLogger(), proc.ID)
                o.callbacks = callbacks
                o.proc = proc
                o.parser = parser
            Severity: Major
            Found in pkg/mirror/apply.go - About 1 hr to fix

              Method sqlRuntimeVariablesStore.Set has 11 return statements (exceeds 4 allowed).
              Open

              func (s *sqlRuntimeVariablesStore) Set(ctx context.Context, variable *datastore.RuntimeVariable) (*datastore.RuntimeVariable, error) {
                  if variable.Name == "" {
                      return nil, datastore.ErrInvalidRuntimeVariableName
                  }
                  if matched, _ := regexp.MatchString(datastore.RuntimeVariableNameRegexPattern, variable.Name); !matched {
              Severity: Major
              Found in pkg/datastore/datastoresql/runtime_variables.go - About 1 hr to fix

                Function PaginationProvider has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                const PaginationProvider = <TArrayItem,>({
                  children,
                  items,
                  pageSize: pageSizeProp,
                }: {
                Severity: Minor
                Found in ui/src/components/PaginationProvider/index.tsx - About 1 hr 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 WorkflowVariablePicker has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                const WorkflowVariablePicker = ({
                  namespace: givenNamespace,
                  workflowPath,
                  defaultVariable,
                  onChange,
                Severity: Minor
                Found in ui/src/components/WorkflowVariablepicker/index.tsx - About 1 hr 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 ArrayItem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                export const ArrayItem: ArrayItemProps = ({
                  defaultValue,
                  renderItem,
                  itemIsValid,
                  onAdd,
                Severity: Minor
                Found in ui/src/components/Form/Array/ArrayItem.tsx - About 1 hr 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 Filters has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                const Filters = ({ filters, onUpdate }: FiltersProps) => {
                  const { t } = useTranslation();
                
                  // activeMenu controls which popover component is opened (there are
                  // separate popovers triggered by the respective buttons)
                Severity: Minor
                Found in ui/src/pages/namespace/Events/History/components/Filters/index.tsx - About 1 hr 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 Instances has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                export const Instances = () => {
                  const {
                    data: dataSuccessfulInstances,
                    isFetched: isFetchedSuccessfulInstances,
                    isAllowed: isAllowedSuccessfulInstances,
                Severity: Minor
                Found in ui/src/pages/namespace/Monitoring/Instances/index.tsx - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
                Open

                const ExplorerPage: FC = () => {
                  const pages = usePages();
                  const namespace = useNamespace();
                  const { path } = pages.explorer.useParams();
                  const { data, isSuccess, isFetched, isAllowed, noPermissionMessage } =
                Severity: Minor
                Found in ui/src/pages/namespace/Explorer/Tree/index.tsx - About 1 hr 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 eventsAndLogic.Run has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (logic *eventsAndLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
                    first, err := scheduleTwice(logic, wakedata)
                    if err != nil {
                        return nil, err
                    }
                Severity: Minor
                Found in pkg/flow/states/eventsAnd.go - About 1 hr to fix

                  Method eventsController.registerCoudEvent has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (c *eventsController) registerCoudEvent(w http.ResponseWriter, r *http.Request) {
                      ns := extractContextNamespace(r)
                      cType := r.Header.Get("Content-type")
                      limit := int64(1024 * 1024 * 32)
                  
                  
                  Severity: Minor
                  Found in pkg/api/events.go - About 1 hr to fix

                    Function createVariables has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const createVariables = async (namespace: string, amount = 5) => {
                      const variables = Array.from({ length: amount }, () => ({
                        name: faker.internet.domainWord(),
                        content: encode(faker.lorem.sentence()),
                        mimeType:
                    Severity: Minor
                    Found in ui/e2e/utils/variables.ts - About 1 hr to fix

                      Method engine.enqueueInstanceMessage has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (engine *engine) enqueueInstanceMessage(ctx context.Context, id uuid.UUID, kind string, data interface{}) error {
                          // TODO: should this add state and step data? At some point these fields died so I have removed them.
                          payload, err := json.Marshal(map[string]interface{}{
                              "type": kind,
                              "data": data,
                      Severity: Minor
                      Found in pkg/flow/instance_messages.go - About 1 hr to fix

                        Function Navigation has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const Navigation: FC = () => {
                          const pages = usePages();
                          const namespace = useNamespace();
                          const { t } = useTranslation();
                          const [, secondPathLevel] = useMatches();
                        Severity: Minor
                        Found in ui/src/components/Navigation/index.tsx - About 1 hr to fix

                          Function PermissionsBreadcrumb has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const PermissionsBreadcrumb = () => {
                            const pages = usePages();
                            const namespace = useNamespace();
                            const { t } = useTranslation();
                          
                          
                          Severity: Minor
                          Found in ui/src/components/Breadcrumb/Permissions/index.tsx - About 1 hr to fix

                            Function getErrorComponent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const getErrorComponent = () => {
                                if (!workflowPath) {
                                  return (
                                    <VariablePickerError>
                                      {t("components.workflowVariablepicker.error.unselected")}
                            Severity: Minor
                            Found in ui/src/components/WorkflowVariablepicker/index.tsx - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language