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
}
Method DelayState.Validate
has 5 return statements (exceeds 4 allowed). Open
func (o *DelayState) Validate() error {
if err := o.commonValidate(); err != nil {
return err
}
Method SubflowFunctionDefinition.Validate
has 5 return statements (exceeds 4 allowed). Open
func (o *SubflowFunctionDefinition) Validate() error {
if o == nil {
return nil
}
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
}
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 "
Method RetryDefinition.Validate
has 5 return statements (exceeds 4 allowed). Open
func (o *RetryDefinition) Validate() error {
if o == nil {
return nil
}
Method ActionDefinition.Validate
has 5 return statements (exceeds 4 allowed). Open
func (o *ActionDefinition) Validate() error {
if o == nil {
return nil
}
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();
- 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 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 {
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();
- 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 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();
- 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 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({
- 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 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}`;
}
- 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 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];
- 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 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())
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 });
- 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 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 != "" {
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 {
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">
Avoid too many return
statements within this function. Open
if (!isRouteListFetched) return null;