rdfio/rdf2smw

View on GitHub

Showing 7 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

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 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

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 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

      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 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

        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
          Severity
          Category
          Status
          Source
          Language