#1268  Code review: Make sure that correct context is visible
Open
jbauer opened 1 year ago

I am not sure if this would be possible but during code review collapsed code lines often result in presenting an irritating context.

For example consider the code

   public void method1() {
     existingCodeLine();
+    newCodeLineAdded();
   }

   public void method2() {

   }
   
   public void method3() {

   }
   
   public void method4() {
     existingCodeLine();
     existingCodeLine();
     existingCodeLine();
+    newCodeLineAdded();
   }

This would result in a collapsed code review view that looks like

   public void method1() {
     existingCodeLine();
+    newCodeLineAdded();
   }

   public void method2() {
// ---------------   
// skipped X lines
// ---------------  
     existingCodeLine();
     existingCodeLine();
     existingCodeLine();
+    newCodeLineAdded();
   }

So now you might think the code has been edited in method2() while in reality it was in method4(). This can be irritating sometimes.

I am wondering if it would be possible for OneDev to make sure to always show the enclosing context of a modified code section, e.g. the method that contains the modified code?

Also as a side note I noticed some skipped 1 line sections which seem useless and you could just render the code line instead. Maybe the skipped X lines block should have a minimum amount of lines before using it. I feel like hiding 1, 2 or maybe even 3 lines does not provide too much value.

issue 1 of 1
Type
Improvement
Priority
Minor
Assignee
Issue Votes (0)
Watchers (4)
Reference
onedev/server#1268
Please wait...
Page is in error, reload to recover