MCPcopy Create free account
hub / github.com/KDAB/codebrowser / p

Function p

data/codebrowser.js:607–666  ·  view source on GitHub ↗
(label, tag)

Source from the content-addressed store, hash-verified

605 });
606
607 var p = function (label, tag) {
608 var d = res.find(tag);
609 if (!d.length)
610 return false;
611 content += "<br/>" + label + ": (" + d.length + ")";
612 if (tag === "inh" && symbolUrl && isType) {
613 content += " &nbsp; [<a href='"+ symbolUrl +"#graph'>Show Graph</a>]";
614 }
615 var shouldCompress = d.length > 15;
616 var dict = { number: 0 };
617 d.each(function() {
618 var th = $(this);
619 var f = th.attr("f");
620 var l = th.attr("l");
621 var t = th.attr("type");
622 if (t) {
623 var prefixL = prefixLen(f, file)
624 if (prefixL >= typePrefixLen) {
625 typePrefixLen = prefixL;
626 type = t;
627 }
628 }
629 if (shouldCompress) {
630 if (!Object.prototype.hasOwnProperty.call(dict, f)) {
631 dict[f] = [];
632 dict.number++;
633 }
634 dict[f].push(l);
635 } else {
636 var url = proj_root_path + "/" + f + ".html#" + l;
637 content += "<br/><a href='" + url +"' >" + f + ":" + l + "</a>";
638 if (tag === "ovr" || tag === "inh") {
639 var c = th.attr("c");
640 if (c)
641 content += " (" + demangleFunctionName(c) + ")";
642 }
643 }
644 });
645 if (shouldCompress) {
646 if (dict.number > 40) {
647 content += "<br/>(Too many)";
648 return false;
649 }
650 for(var f in dict) {
651 if (!Object.prototype.hasOwnProperty.call(dict,f) || f==="number") continue;
652 var url_begin = proj_root_path + "/" + f + ".html";
653 content += "<br/><a href='" + url_begin + "#" + dict[f][0] +"' >" + f + "</a>";
654 var len = dict[f].length;
655 if (len > 100 || (f !== file && len >= 5))
656 content += " (" + len + " times)";
657 else {
658 content += ": <a href='" + url_begin + "#" + dict[f][0] +"' >" + dict[f][0] +"</a>";
659 for(var i = 1; i < len; i++) {
660 content += ", <a href='" + url_begin + "#" + dict[f][i] +"' >" + dict[f][i] +"</a>";
661 }
662 }
663 }
664 }

Callers 1

computeTooltipContentFunction · 0.70

Calls 2

demangleFunctionNameFunction · 0.85
prefixLenFunction · 0.70

Tested by

no test coverage detected