Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Valid issues outside of diff view #135

Open
mdanielak opened this issue Jun 21, 2017 · 4 comments · May be fixed by #161
Open

Valid issues outside of diff view #135

mdanielak opened this issue Jun 21, 2017 · 4 comments · May be fixed by #161

Comments

@mdanielak
Copy link

mdanielak commented Jun 21, 2017

From time to time there is a situation in pull requests when issues appear outside of diff view and comment cannot be added. It happens because bitbucket allows only adding comments in +/- 10 lines from changes lines.
For instance we have multiple files in pull request with many classes and methods. In this pull request there is a method myMethod() declared in line 50. Author adds few if conditions in line 100 and below. After analysis Sonarqube says
The Cyclomatic Complexity of this class is 201 which is greater than 200 authorized.
And comment can't be added because of the diff lines bitbucket limitation.
The same situation can happen with other type of issues like unused imports, consider using constaints instead of duplicating literals, etc
If there are a lot of files, classes and methods in the pull request author is confused and doesn't know where is the problem.
Have you faced this issue before? Are there any plans to handle it?
Thank you

@t-8ch
Copy link
Contributor

t-8ch commented Jun 21, 2017

This is a duplicate of #34, I am closing the other one as this ticket describes the problem better.

@t-8ch
Copy link
Contributor

t-8ch commented Jun 21, 2017

We have some choices:

  1. Add the comment in the diff view as close as we can.
  2. Add the comment in the first possible location after the location in the issue.
  3. Add another comment to the overview listing the issues
  4. Extend the Issues list in the overview comment to add the locations that could not be added to the diff.

Personally I am in favour of 4)

@mdanielak
Copy link
Author

mdanielak commented Jun 28, 2017

I have created a pull request #137. In my solution I decided to add a comment to the top of the file and in comment say precisely in which line issue is. Aditionally this comment is visible in overview but it is not linked with specific line so I added information about a file where issue is located. This path is also a hyperlink.
image

t-8ch added a commit that referenced this issue Nov 1, 2017
this may happen if the issue is reported on a line, that is not directly
involved in the PR

Closes #135 #137
@t-8ch t-8ch linked a pull request Nov 1, 2017 that will close this issue
@t-8ch
Copy link
Contributor

t-8ch commented Nov 1, 2017

@mdanielak Can you take a look at #161?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants