# Git-forensics-plugin

**URL:** <https://community.jenkins.io/t/git-forensics-plugin/11858>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [January 18, 2024, 5:06am UTC](https://community.jenkins.io/t/git-forensics-plugin/11858 "2024-01-18T05:06:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejoe89](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/ejoe89/32/4243_2.png) [@ejoe89](https://community.jenkins.io/u/ejoe89)\
**Post date:** [January 18, 2024, 5:06am UTC](https://community.jenkins.io/t/git-forensics-plugin/11858/1 "2024-01-18T05:06:31Z")

</div>

Using git-forensics-plugin in multibranch pipeline. I am getting the following error:

> [-ERROR-] Errors while obtaining repository statistics  
> [PHPStan] [-ERROR-] No statistics found for file ‘…/…/’

Jenkinsfile snippet:

> stage (‘Git mining’) {  
> steps {  
> discoverGitReferenceBuild(defaultBranch: “main”)  
> mineRepository()  
> gitDiffStat()

I can’t figure out what I am doing wrong and google search brings up nothing useful.

---

<div class="post-metadata">

**Author:** ![uhafner](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/uhafner/32/68_2.png) [@uhafner](https://community.jenkins.io/u/uhafner)\
**Post date:** [January 18, 2024, 7:32am UTC](https://community.jenkins.io/t/git-forensics-plugin/11858/2 "2024-01-18T07:32:02Z")

</div>

This is a warning caused by PHPStan of the warnings plugin. It seems that the parser creates a warning for a file “…/…/”. This file obviously does not exist.

---

<div class="post-metadata">

**Author:** ![ejoe89](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/ejoe89/32/4243_2.png) [@ejoe89](https://community.jenkins.io/u/ejoe89)\
**Post date:** [January 18, 2024, 3:46pm UTC](https://community.jenkins.io/t/git-forensics-plugin/11858/3 "2024-01-18T15:46:51Z")

</div>

I stripped the name out of the post, but maybe something is off path wise in my jenkins file.

---

<div class="post-metadata">

**Author:** ![uhafner](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/uhafner/32/68_2.png) [@uhafner](https://community.jenkins.io/u/uhafner)\
**Post date:** [January 18, 2024, 6:08pm UTC](https://community.jenkins.io/t/git-forensics-plugin/11858/4 "2024-01-18T18:08:48Z")

</div>

This has something to do with the parser resolving absolute paths. If you share the log that contains the warning I can help to see if the parser needs a fix.

---

<div class="post-metadata">

**Author:** ![ejoe89](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/ejoe89/32/4243_2.png) [@ejoe89](https://community.jenkins.io/u/ejoe89)\
**Post date:** [January 18, 2024, 8:56pm UTC](https://community.jenkins.io/t/git-forensics-plugin/11858/5 "2024-01-18T20:56:13Z")

</div>

You want which log? phpcs?

---

<div class="post-metadata">

**Author:** ![uhafner](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/uhafner/32/68_2.png) [@uhafner](https://community.jenkins.io/u/uhafner)\
**Post date:** [January 19, 2024, 9:02am UTC](https://community.jenkins.io/t/git-forensics-plugin/11858/6 "2024-01-19T09:02:27Z")

</div>

It seems that PHPStan reads an XML file with the CheckStyle parser. So we need the part of the XML file that contains issues for the file that has not been found by the forensics plugin. Your marked it with ‘…/…/’.

What exactly is the filename in the warning? What is the absolute filename? You can anonymize the names (but not with …, use words).

---

<div class="post-metadata">

**Author:** ![ejoe89](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/ejoe89/32/4243_2.png) [@ejoe89](https://community.jenkins.io/u/ejoe89)\
**Post date:** [January 21, 2024, 8:05pm UTC](https://community.jenkins.io/t/git-forensics-plugin/11858/7 "2024-01-21T20:05:34Z")

</div>

Actually you helped me solve it. I went and used full paths and not relative paths and it worked perfect!
