dictyBase/modware-annotation

View on GitHub

Showing 12 of 12 total issues

Method arangorepository.EditAnnotation has 57 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (ar *arangorepository) EditAnnotation(uat *annotation.TaggedAnnotationUpdate) (*model.AnnoDoc, error) {
    mann := &model.AnnoDoc{}
    attr := uat.Data.Attributes
    rgt, err := ar.database.Get(
        fmt.Sprintf(
Severity: Minor
Found in internal/repository/arangodb/annotation_write.go - About 1 hr to fix

Method arangorepository.RemoveFromAnnotationGroup has 53 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (ar *arangorepository) RemoveFromAnnotationGroup(
    groupID string,
    idslice ...string,
) (*model.AnnoGroup, error) {
    manno := &model.AnnoGroup{}
Severity: Minor
Found in internal/repository/arangodb/annotation_delete.go - About 1 hr to fix

Method arangorepository.RemoveFromAnnotationGroup has 8 return statements (exceeds 4 allowed).
Open

func (ar *arangorepository) RemoveFromAnnotationGroup(
    groupID string,
    idslice ...string,
) (*model.AnnoGroup, error) {
    manno := &model.AnnoGroup{}
Severity: Major
Found in internal/repository/arangodb/annotation_delete.go - About 50 mins to fix

Method arangorepository.RemoveAnnotation has 7 return statements (exceeds 4 allowed).
Open

func (ar *arangorepository) RemoveAnnotation(id string, purge bool) error {
    manno := &model.AnnoDoc{}
    _, err := ar.anno.annot.ReadDocument(context.Background(), id, manno)
    if err != nil {
        if driver.IsNotFoundGeneral(err) {
Severity: Major
Found in internal/repository/arangodb/annotation_delete.go - About 45 mins to fix

Method arangorepository.EditAnnotation has 6 return statements (exceeds 4 allowed).
Open

func (ar *arangorepository) EditAnnotation(uat *annotation.TaggedAnnotationUpdate) (*model.AnnoDoc, error) {
    mann := &model.AnnoDoc{}
    attr := uat.Data.Attributes
    rgt, err := ar.database.Get(
        fmt.Sprintf(
Severity: Major
Found in internal/repository/arangodb/annotation_write.go - About 40 mins to fix

Method arangorepository.AppendToAnnotationGroup has 6 return statements (exceeds 4 allowed).
Open

func (ar *arangorepository) AppendToAnnotationGroup(groupID string, idslice ...string) (*model.AnnoGroup, error) {
    grp := &model.AnnoGroup{}
    if len(idslice) <= 1 {
        return grp, errors.New("need at least more than one entry to form a group")
    }
Severity: Major
Found in internal/repository/arangodb/annotation_write.go - About 40 mins to fix

Method arangorepository.AddAnnotationGroup has 6 return statements (exceeds 4 allowed).
Open

func (ar *arangorepository) AddAnnotationGroup(idslice ...string) (*model.AnnoGroup, error) {
    grp := &model.AnnoGroup{}
    if len(idslice) <= 1 {
        return grp, errors.New("need at least more than one entry to form a group")
    }
Severity: Major
Found in internal/repository/arangodb/annotation_write.go - About 40 mins to fix

Method AnnotationService.UpdateAnnotation has 5 return statements (exceeds 4 allowed).
Open

func (s *AnnotationService) UpdateAnnotation(
    ctx context.Context,
    rta *annotation.TaggedAnnotationUpdate,
) (*annotation.TaggedAnnotation, error) {
    tga := &annotation.TaggedAnnotation{}
Severity: Major
Found in internal/app/service/write_service.go - About 35 mins to fix

Method AnnotationService.ListAnnotationGroups has 5 return statements (exceeds 4 allowed).
Open

func (srv *AnnotationService) ListAnnotationGroups(
    ctx context.Context, rgp *annotation.ListGroupParameters,
) (*annotation.TaggedAnnotationGroupCollection, error) {
    gac := &annotation.TaggedAnnotationGroupCollection{}
    // default value of limit
Severity: Major
Found in internal/app/service/read_service.go - About 35 mins to fix

Method AnnotationService.ListAnnotations has 5 return statements (exceeds 4 allowed).
Open

func (srv *AnnotationService) ListAnnotations(
    ctx context.Context, ral *annotation.ListParameters,
) (*annotation.TaggedAnnotationCollection, error) {
    tac := &annotation.TaggedAnnotationCollection{}
    // default value of limit
Severity: Major
Found in internal/app/service/read_service.go - About 35 mins to fix

Function RunServer has 5 return statements (exceeds 4 allowed).
Open

func RunServer(clt *cli.Context) error {
    spn, err := repoAndNatsConn(clt)
    if err != nil {
        return cli.NewExitError(err.Error(), errCode)
    }
Severity: Major
Found in internal/app/server/server.go - About 35 mins to fix

Method AnnotationService.GetAnnotation has 5 return statements (exceeds 4 allowed).
Open

func (srv *AnnotationService) GetAnnotation(
    ctx context.Context,
    req *annotation.AnnotationId,
) (*annotation.TaggedAnnotation, error) {
    tna, err := srv.initializeTaggedAnnotation(ctx, req)
Severity: Major
Found in internal/app/service/read_service.go - About 35 mins to fix
Severity
Category
Status
Source
Language