Showing 58 of 640 total issues
Function NewPlaceListPage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewPlaceListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *PlaceListPage {
Function runMinimumSimilarity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func runMinimumSimilarity(gedcom1 *gedcom.Document, gedcom2 *gedcom.Document, idealScore int, options gedcom.SimilarityOptions, tuneFlags *TuneFlags) {
Function runNameToDateRatio
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func runNameToDateRatio(gedcom1 *gedcom.Document, gedcom2 *gedcom.Document, idealScore int, options gedcom.SimilarityOptions, tuneFlags *TuneFlags) {
Function filter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func filter(root Node, fn FilterFunction, entityMap entityMap, document *Document, family *FamilyNode) Node {
Function NewSurnameListPage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewSurnameListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *SurnameListPage {
Function runIndividualWeight
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func runIndividualWeight(gedcom1 *gedcom.Document, gedcom2 *gedcom.Document, idealScore int, options gedcom.SimilarityOptions, tuneFlags *TuneFlags) {
Function NewFamilyListPage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewFamilyListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *FamilyListPage {
Method HTMLFormatter.Write
has 5 return statements (exceeds 4 allowed). Open
Open
func (f *HTMLFormatter) Write(result interface{}) error {
pageTitle := "gedcom"
// Nil should be treated as a blank document.
if gedcom.IsNil(result) {
Method ResidenceNode.Equals
has 5 return statements (exceeds 4 allowed). Open
Open
func (node *ResidenceNode) Equals(node2 Node) bool {
if IsNil(node) {
return false
}
Method Publisher.Places
has 5 return statements (exceeds 4 allowed). Open
Open
func (publisher *Publisher) Places() map[string]*place {
if publisher.placesMap == nil {
publisher.placesMap = map[string]*place{}
// Get all of the unique place names.
Method EventNode.Equals
has 5 return statements (exceeds 4 allowed). Open
Open
func (node *EventNode) Equals(node2 Node) bool {
if IsNil(node) {
return false
}
Method UniqueIDNode.Equals
has 5 return statements (exceeds 4 allowed). Open
Open
func (node *UniqueIDNode) Equals(node2 Node) bool {
if IsNil(node) {
return false
}
Function DeepEqual
has 5 return statements (exceeds 4 allowed). Open
Open
func DeepEqual(left, right Node) bool {
if IsNil(left) {
return false
}
Method SimpleNode.Equals
has 5 return statements (exceeds 4 allowed). Open
Open
func (node *SimpleNode) Equals(node2 Node) bool {
if node == nil {
return false
}
Method AccessorExpr.Evaluate
has 5 return statements (exceeds 4 allowed). Open
Open
func (e *AccessorExpr) Evaluate(engine *Engine, input interface{}, args []*Statement) (interface{}, error) {
in := reflect.ValueOf(input)
accessor := e.Query[1:]
if input == nil {
Method GEDCOMFormatter.Write
has 5 return statements (exceeds 4 allowed). Open
Open
func (f *GEDCOMFormatter) Write(result interface{}) error {
// Nil should be treated as a blank document.
if gedcom.IsNil(result) {
return nil
}
Method IndividualEvents.WriteHTMLTo
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *IndividualEvents) WriteHTMLTo(w io.Writer) (int64, error) {
var events []core.Component
for _, event := range c.individual.AllEvents() {
date, place := gedcom.DateAndPlace(event)
- 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 IndividualNodesCompareOptions.collectResults
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
Open
func (o *IndividualNodesCompareOptions) collectResults(results chan *IndividualComparison, totals chan int64) chan *IndividualComparison {
// See description in createJobs().
similarities := make(chan *IndividualComparison, 1000)
go func() {
- 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"