Showing 27 of 170 total issues
Function TodoForm
has 212 lines of code (exceeds 75 allowed). Consider refactoring. Open
export function TodoForm(props: NewTodoFormProps) {
const [loading, setLoading] = useState(false);
const createTodo = useStore((state) => state.createTodo);
const updateTodo = useStore((state) => state.updateTodo);
Method userController.V1UserUpdate
has a Cognitive Complexity of 25 (exceeds 10 allowed). Consider refactoring. Open
func (c *userController) V1UserUpdate(ctx context.Context, request api.V1UserUpdateRequestObject) (api.V1UserUpdateResponseObject, error) {
ctx, span := c.tracer.Start(ctx, "transport.http.handler/V1UserUpdate")
defer span.End()
userID, err := model.NewIDFromString(request.Id, model.ResourceTypeUser.String())
- 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 IssueRepository.scan
has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring. Open
func (r *IssueRepository) scan(params *issueScanParams) func(rec *neo4j.Record) (*model.Issue, error) {
return func(rec *neo4j.Record) (*model.Issue, error) {
issue := new(model.Issue)
issue.Links = make([]string, 0)
- 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 Issue.Validate
has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring. Open
func (i *Issue) Validate() error {
if err := validate.Struct(i); err != nil {
return errors.Join(ErrInvalidIssueDetails, err)
}
if err := i.ID.Validate(); err != nil {
- 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 TodoDrawer
has 112 lines of code (exceeds 75 allowed). Consider refactoring. Open
export function TodoDrawer() {
const [showNewTodoForm, setShowNewTodoForm] = useState(false);
const [todos, show, toggleDrawer, fetchingTodos, fetchTodos, updateTodo] = useStore((state) => [
state.todos,
Function SystemSettings
has 104 lines of code (exceeds 75 allowed). Consider refactoring. Open
export default async function SystemSettings() {
const { license, version } = await getData();
return (
<div className="space-y-8 divide-y divide-gray-100">
Function SignInForm
has 89 lines of code (exceeds 75 allowed). Consider refactoring. Open
export function SignInForm() {
const form = useRef<HTMLFormElement>(null);
const [csrfToken, setCSRFToken] = useState('');
const [submitting, setSubmitting] = useState(false);
Function TodoForm
has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring. Open
export function TodoForm(props: NewTodoFormProps) {
const [loading, setLoading] = useState(false);
const createTodo = useStore((state) => state.createTodo);
const updateTodo = useStore((state) => state.updateTodo);
- 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 userController.V1UserUpdate
has 12 return statements (exceeds 7 allowed). Open
func (c *userController) V1UserUpdate(ctx context.Context, request api.V1UserUpdateRequestObject) (api.V1UserUpdateResponseObject, error) {
ctx, span := c.tracer.Start(ctx, "transport.http.handler/V1UserUpdate")
defer span.End()
userID, err := model.NewIDFromString(request.Id, model.ResourceTypeUser.String())
Method DocumentRepository.scan
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
func (r *DocumentRepository) scan(dp, cp, lp, commp, ap string) func(rec *neo4j.Record) (*model.Document, error) {
return func(rec *neo4j.Record) (*model.Document, error) {
doc := new(model.Document)
val, _, err := neo4j.GetRecordValue[neo4j.Node](rec, dp)
- 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 Issue.Validate
has 11 return statements (exceeds 7 allowed). Open
func (i *Issue) Validate() error {
if err := validate.Struct(i); err != nil {
return errors.Join(ErrInvalidIssueDetails, err)
}
if err := i.ID.Validate(); err != nil {
Function NewRouter
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
func NewRouter(strictServer StrictServer, serverConfig *config.ServerConfig, tracer tracing.Tracer) (http.Handler, error) {
if serverConfig == nil {
return nil, config.ErrNoConfig
}
- 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 TodoDrawer
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
export function TodoDrawer() {
const [showNewTodoForm, setShowNewTodoForm] = useState(false);
const [todos, show, toggleDrawer, fetchingTodos, fetchTodos, updateTodo] = useStore((state) => [
state.todos,
- 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 userService.Update
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
func (s *userService) Update(ctx context.Context, id model.ID, patch map[string]any) (*model.User, error) {
ctx, span := s.tracer.Start(ctx, "service.userService/Update")
defer span.End()
if expired, err := s.licenseService.Expired(ctx); expired || err != nil {
- 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 NewServer
has 9 return statements (exceeds 7 allowed). Open
func NewServer(opts ...ControllerOption) (StrictServer, error) {
var err error
c, err := newController(opts...)
if err != nil {
Method systemService.checkStatus
has 7 arguments (exceeds 6 allowed). Consider refactoring. Open
ctx context.Context,
name model.HealthCheckComponent,
resource Pingable,
response map[model.HealthCheckComponent]model.HealthStatus,
errCh chan error,
Method userService.Delete
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
func (s *userService) Delete(ctx context.Context, id model.ID, force bool) error {
ctx, span := s.tracer.Start(ctx, "service.userService/Delete")
defer span.End()
if expired, err := s.licenseService.Expired(ctx); expired || err != nil {
- 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 NewLicense
has 8 return statements (exceeds 7 allowed). Open
func NewLicense(licenseKey, pubKey string) (*License, error) {
var err error
key, err := lk.PublicKeyFromB32String(pubKey)
if err != nil {
Method ProjectRepository.scan
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
func (r *ProjectRepository) scan(pp, dp, tp, ip string) func(rec *neo4j.Record) (*model.Project, error) {
return func(rec *neo4j.Record) (*model.Project, error) {
p := new(model.Project)
val, _, err := neo4j.GetRecordValue[neo4j.Node](rec, pp)
- 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 OrganizationRepository.scan
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
func (r *OrganizationRepository) scan(op, np, tp, mp string) func(rec *neo4j.Record) (*model.Organization, error) {
return func(rec *neo4j.Record) (*model.Organization, error) {
org := new(model.Organization)
val, _, err := neo4j.GetRecordValue[neo4j.Node](rec, op)
- 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"