david-mccullars/text_rank

View on GitHub

Showing 3 of 5 total issues

Complex method PageRank::Sparse#calculate_step (35.4)
Open

    def calculate_step(ranks)
      ranks.keys.each_with_object({}) do |dest, new_ranks|
        sum = 0.0
        Array(@graph[dest]).each do |source|
          sum += ranks[source] * @normalized_weights[source][dest]
Severity: Minor
Found in lib/page_rank/sparse.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method PageRank::Dense#to_matrix (35.0)
Open

    def to_matrix
      total_out_weights = @out_links.map do |links|
        links&.compact&.reduce(:+)
      end
      Matrix.build(node_count, node_count) do |dest_idx, source_idx|
Severity: Minor
Found in lib/page_rank/dense.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

The function Init_text_rank is never used.
Open

void Init_text_rank() {
Severity: Minor
Found in ext/text_rank/text_rank.c by cppcheck

The function Init_text_rank is never used. (detailed CWE explanation)

Severity
Category
Status
Source
Language