Showing 58 of 640 total issues
Method PartnersAndChildren.WriteHTMLTo
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *PartnersAndChildren) WriteHTMLTo(w io.Writer) (int64, error) {
heading := core.NewHeading(2, "", core.NewText("Spouses & Children"))
column := core.NewColumn(core.EntireRow, heading)
rows := []core.Component{
Method IndividualNodesCompareOptions.calculateWinners
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
Open
func (o *IndividualNodesCompareOptions) calculateWinners(a, b IndividualNodes, similarityResults chan *IndividualComparison, options SimilarityOptions) chan *IndividualComparison {
// See description in createJobs().
winners := 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"
Further reading
Function NewDiffPage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewDiffPage(comparisons gedcom.IndividualComparisons, filterFlags *gedcom.FilterFlags, googleAnalyticsID string, show, sort string, progress chan gedcom.Progress, compareOptions *gedcom.IndividualNodesCompareOptions, visibility LivingVisibility) *DiffPage {
Function NewSourcePage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewSourcePage(document *gedcom.Document, source *gedcom.SourceNode, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *SourcePage {
Method LastExpr.Evaluate
has 7 return statements (exceeds 4 allowed). Open
Open
func (e *LastExpr) Evaluate(engine *Engine, input interface{}, args []*Statement) (interface{}, error) {
in := reflect.ValueOf(input)
if len(args) != 1 {
return nil, errors.New("function Last() must take a single argument")
Function NewIndividualListPage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewIndividualListPage(document *gedcom.Document, selectedLetter rune, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *IndividualListPage {
Function NewPlacePage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewPlacePage(document *gedcom.Document, placeKey string, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *PlacePage {
Function NewIndividualPage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewIndividualPage(document *gedcom.Document, individual *gedcom.IndividualNode, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *IndividualPage {
Function NewPublishHeader
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewPublishHeader(document *gedcom.Document, extraTab string, selectedTab string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *PublishHeader {
Function runDiffCommand
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
func runDiffCommand() {
var optionLeftGedcomFile string
var optionRightGedcomFile string
var optionOutputFile string
var optionShow string // see optionShow constants.
- 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 BinaryExpr.Evaluate
has 6 return statements (exceeds 4 allowed). Open
Open
func (e *BinaryExpr) Evaluate(engine *Engine, input interface{}, args []*Statement) (interface{}, error) {
in := reflect.ValueOf(input)
// If it is a slice we need to Evaluate each one.
if in.Kind() == reflect.Slice {
Method FirstExpr.Evaluate
has 6 return statements (exceeds 4 allowed). Open
Open
func (e *FirstExpr) Evaluate(engine *Engine, input interface{}, args []*Statement) (interface{}, error) {
in := reflect.ValueOf(input)
if len(args) != 1 {
return nil, fmt.Errorf("function First() must take a single argument")
Function runMaxYears
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func runMaxYears(gedcom1 *gedcom.Document, gedcom2 *gedcom.Document, idealScore int, options gedcom.SimilarityOptions, tuneFlags *TuneFlags) {
Function NewSourceListPage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewSourceListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *SourceListPage {
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 {
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 NewIndividualEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewIndividualEvent(date, place string, description core.Component, individual *gedcom.IndividualNode, event gedcom.Node, placesMap map[string]*place) *IndividualEvent {
Function runJaroBoost
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func runJaroBoost(gedcom1 *gedcom.Document, gedcom2 *gedcom.Document, idealScore int, options gedcom.SimilarityOptions, tuneFlags *TuneFlags) {
Function runJaroPrefixSize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func runJaroPrefixSize(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 {