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
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}
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 (
Function App
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const App = () => {
const theme = useTheme();
const { setSystemTheme } = useThemeActions();
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 {
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
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 {
Function PaginationProvider
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const PaginationProvider = <TArrayItem,>({
children,
items,
pageSize: pageSizeProp,
}: {
- Read upRead up
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,
- Read upRead up
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,
- Read upRead up
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)
- Read upRead up
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,
- Read upRead up
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 } =
- Read upRead up
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
}
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)
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:
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,
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();
Function PermissionsBreadcrumb
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PermissionsBreadcrumb = () => {
const pages = usePages();
const namespace = useNamespace();
const { t } = useTranslation();
Function getErrorComponent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getErrorComponent = () => {
if (!workflowPath) {
return (
<VariablePickerError>
{t("components.workflowVariablepicker.error.unselected")}