rdfio/rdf2smw

View on GitHub

Showing 70 of 70 total issues

Method TripleAggregateToWikiPageConverter.Run has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
Open

func (p *TripleAggregateToWikiPageConverter) Run() {
defer close(p.OutPage)
 
predPageIndex := make(map[string]*WikiPage)
 
 
Severity: Minor
Found in components/triplestowikipageconv.go - About 4 hrs to fix

Method MWXMLCreator.Run has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
Open

func (p *MWXMLCreator) Run() {
tplPropertyIdx := make(map[string]map[string]int)
 
defer close(p.OutTemplates)
defer close(p.OutProperties)
Severity: Minor
Found in components/mwxmlcreator.go - About 3 hrs to fix

Method MWXMLCreator.Run has 72 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (p *MWXMLCreator) Run() {
tplPropertyIdx := make(map[string]map[string]int)
 
defer close(p.OutTemplates)
defer close(p.OutProperties)
Severity: Minor
Found in components/mwxmlcreator.go - About 1 hr to fix

    Method TripleAggregateToWikiPageConverter.Run has 67 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (p *TripleAggregateToWikiPageConverter) Run() {
    defer close(p.OutPage)
     
    predPageIndex := make(map[string]*WikiPage)
     
     
    Severity: Minor
    Found in components/triplestowikipageconv.go - About 1 hr to fix

      Method TripleAggregateToWikiPageConverter.determineType has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
      Open

      func (p *TripleAggregateToWikiPageConverter) determineType(uriAggr *TripleAggregate) int {
      if uriAggr != nil {
      if uriAggr.Triples != nil {
      for _, tr := range uriAggr.Triples {
      for _, propType := range propertyTypes {
      Severity: Minor
      Found in components/triplestowikipageconv.go - About 1 hr to fix

      Function main has 56 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func main() {
      //flowbase.InitLogDebug()
       
      inFileName := flag.String("in", "", "The input file name")
      outFileName := flag.String("out", "", "The output file name")
      Severity: Minor
      Found in main.go - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        for triple, err := dec.Decode(); err != io.EOF; triple, err = dec.Decode() {
        if err != nil {
        log.Fatal("Could not encode to triple: ", err.Error())
        } else if triple.Subj != nil && triple.Pred != nil && triple.Obj != nil {
        p.OutTriple <- triple
        Severity: Major
        Found in components/ttlfilereader.go and 1 other location - About 1 hr to fix
        components/tripleparser.go on lines 28..36

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        for triple, err := dec.Decode(); err != io.EOF; triple, err = dec.Decode() {
        if err != nil {
        log.Fatal("Could not encode to triple: ", err.Error())
        } else if triple.Subj != nil && triple.Pred != nil && triple.Obj != nil {
        p.Out <- triple
        Severity: Major
        Found in components/tripleparser.go and 1 other location - About 1 hr to fix
        components/ttlfilereader.go on lines 54..62

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        func (f *Fact) escapeWikiChars(inStr string) string {
        outStr := str.Replace(inStr, "[", "(", -1)
        outStr = str.Replace(outStr, "]", ")", -1)
        outStr = str.Replace(outStr, "|", ",", -1)
        outStr = str.Replace(outStr, "=", "-", -1)
        Severity: Minor
        Found in components/iptypes.go and 1 other location - About 45 mins to fix
        components/mwxmlcreator.go on lines 165..173

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        func escapeWikiChars(inStr string) string {
        outStr := str.Replace(inStr, "[", "(", -1)
        outStr = str.Replace(outStr, "]", ")", -1)
        outStr = str.Replace(outStr, "|", ",", -1)
        outStr = str.Replace(outStr, "=", "-", -1)
        Severity: Minor
        Found in components/mwxmlcreator.go and 1 other location - About 45 mins to fix
        components/iptypes.go on lines 103..111

        Function NewWikiPage has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func NewWikiPage(title string, facts []*Fact, categories []*Category, specificCategory *Category, pageType int) *WikiPage {
        Severity: Minor
        Found in components/iptypes.go - About 35 mins to fix

          exported type CategoryFilterer should have comment or be unexported
          Open

          type CategoryFilterer struct {
          Severity: Minor
          Found in components/catfilterer.go by golint

          exported method ResourceIndexCreator.Run should have comment or be unexported
          Open

          func (p *ResourceIndexCreator) Run() {
          Severity: Minor
          Found in components/residxcreator.go by golint

          exported method StringFileWriter.Run should have comment or be unexported
          Open

          func (p *StringFileWriter) Run() {
          Severity: Minor
          Found in components/strfilewriter.go by golint

          exported const BUFSIZE should have comment (or a comment on this block) or be unexported
          Open

          BUFSIZE = 16
          Severity: Minor
          Found in main.go by golint

          exported method WikiPage.AddFactUnique should have comment or be unexported
          Open

          func (p *WikiPage) AddFactUnique(fact *Fact) {
          Severity: Minor
          Found in components/iptypes.go by golint

          exported type Fact should have comment or be unexported
          Open

          type Fact struct {
          Severity: Minor
          Found in components/iptypes.go by golint

          var valueUriType should be valueURIType
          Open

          valueUriType := p.determineType(valueAggr)
          Severity: Minor
          Found in components/triplestowikipageconv.go by golint

          exported function NewCategoryFilterer should have comment or be unexported
          Open

          func NewCategoryFilterer(categories []*Category) *CategoryFilterer {
          Severity: Minor
          Found in components/catfilterer.go by golint

          exported method WikiPage.AddCategory should have comment or be unexported
          Open

          func (p *WikiPage) AddCategory(category *Category) {
          Severity: Minor
          Found in components/iptypes.go by golint
          Severity
          Category
          Status
          Source
          Language