Skip to content

Commit a975553

Browse files
committed
Added line numbers to summary log
1 parent ca4dc86 commit a975553

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

src/main/php/PDepend/Report/Summary/Xml.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ private function generateTypeXml(ASTClass $type, $typeIdentifier)
292292

293293
$typeXml = $doc->createElement($typeIdentifier);
294294
$typeXml->setAttribute('name', Utf8Util::ensureEncoding($type->getName()));
295+
$typeXml->setAttribute('start', Utf8Util::ensureEncoding($type->getStartLine()));
296+
$typeXml->setAttribute('end', Utf8Util::ensureEncoding($type->getEndLine()));
295297

296298
$this->writeNodeMetrics($typeXml, $type);
297299
$this->writeFileReference($typeXml, $type->getCompilationUnit());
@@ -323,6 +325,8 @@ public function visitFunction(ASTFunction $function)
323325

324326
$functionXml = $doc->createElement('function');
325327
$functionXml->setAttribute('name', Utf8Util::ensureEncoding($function->getName()));
328+
$functionXml->setAttribute('start', Utf8Util::ensureEncoding($function->getStartLine()));
329+
$functionXml->setAttribute('end', Utf8Util::ensureEncoding($function->getEndLine()));
326330

327331
$this->writeNodeMetrics($functionXml, $function);
328332
$this->writeFileReference($functionXml, $function->getCompilationUnit());
@@ -354,6 +358,8 @@ public function visitMethod(ASTMethod $method)
354358

355359
$methodXml = $doc->createElement('method');
356360
$methodXml->setAttribute('name', Utf8Util::ensureEncoding($method->getName()));
361+
$methodXml->setAttribute('start', Utf8Util::ensureEncoding($method->getStartLine()));
362+
$methodXml->setAttribute('end', Utf8Util::ensureEncoding($method->getEndLine()));
357363

358364
$this->writeNodeMetrics($methodXml, $method);
359365

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<metrics generated="2009-07-27T18:00:36" pdepend="@package_version@" bar="23" foo="42">
2+
<metrics generated="2015-09-23T06:23:29" pdepend="@package_version@" bar="23" foo="42">
33
<files>
44
<file name="???" baz="23" foobar="42"/>
55
</files>
66
<package name="+global" baz="23" foobar="42">
7-
<function name="bar" baz="23" foobar="42">
7+
<function name="bar" start="56" end="58" baz="23" foobar="42">
88
<file name="???"/>
99
</function>
1010
</package>
1111
<package name="pkg1" baz="23" foobar="42">
12-
<class name="FooBar" baz="23" foobar="42">
12+
<class name="FooBar" start="30" end="49" baz="23" foobar="42">
1313
<file name="???"/>
14-
<method name="x" baz="23" foobar="42"/>
15-
<method name="y" baz="23" foobar="42"/>
14+
<method name="x" start="43" end="43" baz="23" foobar="42"/>
15+
<method name="y" start="44" end="48" baz="23" foobar="42"/>
1616
</class>
17-
<function name="foo" baz="23" foobar="42">
17+
<function name="foo" start="7" end="11" baz="23" foobar="42">
1818
<file name="???"/>
1919
</function>
2020
</package>
2121
<package name="pkg3" baz="23" foobar="42">
22-
<class name="Bar" baz="23" foobar="42">
22+
<class name="Bar" start="23" end="25" baz="23" foobar="42">
2323
<file name="???"/>
24-
<method name="y" baz="23" foobar="42"/>
24+
<method name="y" start="24" end="24" baz="23" foobar="42"/>
2525
</class>
2626
</package>
2727
</metrics>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<metrics generated="2009-07-27T18:00:36" pdepend="@package_version@">
2+
<metrics generated="2015-09-23T06:23:41" pdepend="@package_version@">
33
<files>
44
<file name="???"/>
55
</files>
66
<package name="+global" loc="42" ncloc="23">
7-
<function name="bar" loc="9" ncloc="7">
7+
<function name="bar" start="56" end="58" loc="9" ncloc="7">
88
<file name="???"/>
99
</function>
1010
</package>
1111
<package name="pkg1" loc="101" ncloc="99">
12-
<class name="FooBar" loc="90" ncloc="80">
12+
<class name="FooBar" start="30" end="49" loc="90" ncloc="80">
1313
<file name="???"/>
14-
<method name="x" loc="50" ncloc="45"/>
15-
<method name="y" loc="30" ncloc="22"/>
14+
<method name="x" start="43" end="43" loc="50" ncloc="45"/>
15+
<method name="y" start="44" end="48" loc="30" ncloc="22"/>
1616
</class>
17-
<function name="foo" loc="9" ncloc="9">
17+
<function name="foo" start="7" end="11" loc="9" ncloc="9">
1818
<file name="???"/>
1919
</function>
2020
</package>
2121
<package name="pkg3" loc="42" ncloc="23">
22-
<class name="Bar" loc="33" ncloc="20">
22+
<class name="Bar" start="23" end="25" loc="33" ncloc="20">
2323
<file name="???"/>
24-
<method name="y" loc="9" ncloc="7"/>
24+
<method name="y" start="24" end="24" loc="9" ncloc="7"/>
2525
</class>
2626
</package>
2727
</metrics>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<metrics generated="2009-07-27T18:00:36" pdepend="@package_version@">
2+
<metrics generated="2015-09-23T06:23:10" pdepend="@package_version@">
33
<files>
44
<file name="???"/>
55
</files>
66
<package name="+global">
7-
<function name="bar">
7+
<function name="bar" start="56" end="58">
88
<file name="???"/>
99
</function>
1010
</package>
1111
<package name="pkg1">
12-
<class name="FooBar">
12+
<class name="FooBar" start="30" end="49">
1313
<file name="???"/>
14-
<method name="x"/>
15-
<method name="y"/>
14+
<method name="x" start="43" end="43"/>
15+
<method name="y" start="44" end="48"/>
1616
</class>
17-
<function name="foo">
17+
<function name="foo" start="7" end="11">
1818
<file name="???"/>
1919
</function>
2020
</package>
2121
<package name="pkg3">
22-
<class name="Bar">
22+
<class name="Bar" start="23" end="25">
2323
<file name="???"/>
24-
<method name="y"/>
24+
<method name="y" start="24" end="24"/>
2525
</class>
2626
</package>
27-
</metrics>
27+
</metrics>

0 commit comments

Comments
 (0)