* Get a node's weight by regular expressions. * @param node the node element. * @return {Number}
(node)
| 607 | * @return {Number} |
| 608 | */ |
| 609 | function getClassWeight(node){ |
| 610 | var weight = 0; |
| 611 | |
| 612 | var classAndId = [node.attr('class') || '', node.attr('id') || ''].join(' '); |
| 613 | if (classAndId.search(regexps.negative) >= 0) { |
| 614 | weight -= 25; |
| 615 | } |
| 616 | if (classAndId.search(regexps.positive) >= 0) { |
| 617 | weight += 25; |
| 618 | } |
| 619 | |
| 620 | return weight; |
| 621 | } |
| 622 | |
| 623 | /** |
| 624 | * Get the density of links as a percentage of the content. |
no outgoing calls
no test coverage detected
searching dependent graphs…