Sha256: 82146c28efff943093eb5e9815f777ffdeb2d75653ba18d6e702b6d0c2a136ad

Contents?: true

Size: 435 Bytes

Versions: 1

Compression:

Stored size: 435 Bytes

Contents

module CognitiveDistance::Measurements
  class DistinctModuleHops
    extend Measurement

    register :distinct_module_hops

    def measure tree
      CognitiveDistance::Transforms::CallTreeToModuleBoundaryGraph.
        transform(tree).map { |(v1,v2)|
          [v1.context, v2.context]
        }.uniq.size
    end

    def self.measure obj, meth
      new.measure(CognitiveDistance::Tracer.new(obj).trace(meth))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cognitive_distance-0.0.1.pre lib/cognitive_distance/measurements/distinct_module_hops.rb