// ignore a node (and sub-tree) if it is tagged with a "#nosec" comment
421078
func (gosec *Analyzer) ignore(n ast.Node) ([]string, bool) {
	if groups, ok := gosec.context.Comments[n]; ok && !gosec.ignoreNosec {
		for _, group := range groups {
			if strings.Contains(group.Text(), "#nosec") {
				gosec.stats.NumNosec++

				// Pull out the specific rules that are listed to be ignored.
				re := regexp.MustCompile(`(G\d{3})`)
				matches := re.FindAllStringSubmatch(group.Text(), -1)

				// If no specific rules were given, ignore everything.
				if len(matches) == 0 {
					return nil, true
				}

				// Find the rule IDs to ignore.
				var ignores []string
				for _, v := range matches {
					ignores = append(ignores, v[1])
				}
				return ignores, false
			}
		}
	}
	return nil, false
}
1025679
func (s FieldSort) IgnoreUnmapped(ignoreUnmapped bool) FieldSort {
	s.ignoreUnmapped = &ignoreUnmapped
	return s
}
1348686
func (p *Parser) patch(lut []int, node *parser.Node) {
	node.Range.A = lut[node.Range.A]
	node.Range.B = lut[node.Range.B]
	for _, child := range node.Children {
		p.patch(lut, child)
	}
}
1158732
func (q *ParentIdQuery) IgnoreUnmapped(ignore bool) *ParentIdQuery {
	q.ignoreUnmapped = &ignore
	return q
}
1078780
func (q *NestedQuery) IgnoreUnmapped(value bool) *NestedQuery {
	q.ignoreUnmapped = &value
	return q
}
1259294
func (f *Folder) forgetNode(node libkbfs.Node) {
	f.nodesMu.Lock()
	defer f.nodesMu.Unlock()

	delete(f.nodes, node.GetID())
	if len(f.nodes) == 0 {
		ctx := libcontext.BackgroundContextWithCancellationDelayer()
		defer libcontext.CleanupCancellationDelayer(ctx)
		f.unsetFolderBranch(ctx)
		f.list.forgetFolder(string(f.name()))
	}
}
413500
func (c *Comments) applyComments(node, previous Node, position CommentPosition) {
	if previous != nil {
		c.CommentMap.AddComments(previous, c.Comments, position)
		c.Comments = nil
	} else {
		c.CommentMap.AddComments(node, c.Comments, position)
		c.Comments = nil
	}
	// Only apply the future comments to the node if the previous is set.
	// This is for detecting end of line comments and which node comments on the following lines belongs to
	if previous != nil {
		c.CommentMap.AddComments(node, c.future, position)
		c.future = nil
	}
}
72842
func (woc *wfOperationCtx) markNodeErrorClearOuput(nodeName string, err error) *wfv1.NodeStatus {
	nodeStatus := woc.markNodeError(nodeName, err)
	nodeStatus.Outputs = nil
	woc.wf.Status.Nodes[nodeStatus.ID] = *nodeStatus
	return nodeStatus
}
124657
func (woc *wfOperationCtx) addChildNode(parent string, child string) {
	parentID := woc.wf.NodeID(parent)
	childID := woc.wf.NodeID(child)
	node, ok := woc.wf.Status.Nodes[parentID]
	if !ok {
		panic(fmt.Sprintf("parent node %s not initialized", parent))
	}
	for _, nodeID := range node.Children {
		if childID == nodeID {
			// already exists
			return
		}
	}
	node.Children = append(node.Children, childID)
	woc.wf.Status.Nodes[parentID] = node
	woc.updated = true
}
352077
func (e *Event) ignoreLinux(mask uint32) bool {
	// Ignore anything the inotify API says to ignore
	if mask&unix.IN_IGNORED == unix.IN_IGNORED {
		return true
	}

	// If the event is not a DELETE or RENAME, the file must exist.
	// Otherwise the event is ignored.
	// *Note*: this was put in place because it was seen that a MODIFY
	// event was sent after the DELETE. This ignores that MODIFY and
	// assumes a DELETE will come or has come if the file doesn't exist.
	if !(e.Op&Remove == Remove || e.Op&Rename == Rename) {
		_, statErr := os.Lstat(e.Name)
		return os.IsNotExist(statErr)
	}
	return false
}
418366
func structFieldIgnored(f reflect.StructField) bool {
	if !f.Anonymous {
		return true // if not anonymous(embedded), ignore it.
	}

	s := f.Tag.Get("ignore")
	return s == "true" // if has an ignore tag then ignore it.
}
634349
func (f *FailFilter) Filter(nodes []Node) []Node {
	if len(nodes) <= 1 || f.MaxFails <= 0 {
		return nodes
	}
	nl := []Node{}
	for i := range nodes {
		marker := &failMarker{}
		if nil != nodes[i].marker {
			marker = nodes[i].marker.Clone()
		}
		// log.Logf("%s: %d/%d %v/%v", nodes[i], marker.failCount, f.MaxFails, marker.failTime, f.FailTimeout)
		if marker.failCount < uint32(f.MaxFails) ||
			time.Since(time.Unix(marker.failTime, 0)) >= f.FailTimeout {
			nl = append(nl, nodes[i])
		}
	}
	return nl
}
902042
func (fiInfo *FieldInfo) Ignored() bool {
	tagJSON := ucon.NewTagJSON(fiInfo.Base.Tag)
	if tagJSON.Ignored() {
		return true
	}

	return false
}
843502
func (bi *blockIndex) addNode(node *blockNode) {
	bi.index[node.hash] = node
}
1160617
func unmarshalReplyTree(raw json.RawMessage) ([]*Comment, []*Message, error) {
	repliesThing, err := unmarshalThing(raw)
	if err != nil {
		// When a supply tree is not included, the field is a string,
		// which the JSON unmarshaller chokes on.
		return nil, nil, nil
	}

	bufferInterface, err := parseThing(repliesThing)
	if err != nil {
		return nil, nil, err
	}

	buffer, ok := bufferInterface.(*listingBuffer)
	if !ok {
		return nil,
			nil,
			fmt.Errorf("listing buffer corrupted or mislabeled")
	}

	return buffer.comments, buffer.messages, nil
}
745679
func (l *level) pruneNode(n *node, t string) {
	if n == nil {
		return
	}
	if n == l.fwc {
		l.fwc = nil
	} else if n == l.pwc {
		l.pwc = nil
	} else {
		delete(l.nodes, t)
	}
}
1307793
func (q *MoreLikeThisQuery) IgnoreLikeText(ignoreLikeText ...string) *MoreLikeThisQuery {
	for _, s := range ignoreLikeText {
		item := NewMoreLikeThisQueryItem().LikeText(s)
		q.unlikeDocs = append(q.unlikeDocs, item)
	}
	return q
}