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 NewIndividualCompare
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewIndividualCompare(comparison *gedcom.IndividualComparison, filterFlags *gedcom.FilterFlags, progress chan gedcom.Progress, compareOptions *gedcom.IndividualNodesCompareOptions, visibility LivingVisibility) *IndividualCompare {
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 newNodeWithChildren
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func newNodeWithChildren(document *Document, family *FamilyNode, tag Tag, value, pointer string, children Nodes) 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 NewStatisticsPage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewStatisticsPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *StatisticsPage {
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 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 ResidenceNode.Equals
has 5 return statements (exceeds 4 allowed). Open
Open
func (node *ResidenceNode) Equals(node2 Node) bool {
if IsNil(node) {
return false
}
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
}
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 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 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
Function DeepEqual
has 5 return statements (exceeds 4 allowed). Open
Open
func DeepEqual(left, right Node) bool {
if IsNil(left) {
return false
}
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"