Spaces Data
Minimal test - lines (252, 282)
path: .spaces[3].spaces[8].metrics.loc.sloc
old: 30.0
new: 31.0
path: .spaces[3].spaces[8].metrics.loc.cloc
old: 6.0
new: 7.0
path: .spaces[3].spaces[8].metrics.mi.mi_original
old: 81.21060208772849
new: 80.67940695799604
path: .spaces[3].spaces[8].metrics.mi.mi_sei
old: 74.00769059683711
new: 74.87830799276945
path: .spaces[3].spaces[8].metrics.mi.mi_visual_studio
old: 47.491580168262274
new: 47.18093974151815
Code
def ref_path(self, path):
# The ref parameter can be one of several things
# 1. An absolute path to a reference file
# 2. A path to a file relative to the topsrcdir
# 3. A path relative to the test file
# These are not unambiguous, so it's somewhat best effort
if os.path.isabs(path):
path = os.path.normpath(path)
if not path.startswith(self.topsrcdir):
# Path is an absolute URL relative to the tests root
if path.startswith("/_mozilla/"):
base = self.local_path
path = path[len("/_mozilla/") :]
else:
base = self.upstream_path
path = path[1:]
path = path.replace("/", os.sep)
return os.path.join(base, path)
else:
return self.src_rel_path(path)
else:
if self.wpt_type(path) is not None:
return path
else:
test_rel_path = self.src_rel_path(
os.path.join(os.path.dirname(self.test), path)
)
if self.wpt_type(test_rel_path) is not None:
return test_rel_path
# Returning None indicates that the path wasn't valid