Vivek504 opened a new pull request, #166:
URL: https://github.com/apache/pdfbox/pull/166

   ### Extract method refactoring
   **Class:** org.apache.pdfbox.io.ScratchFile
   **Reason for refactoring:** Complex method - Cyclomatic complexity of 
enlarge() method is 9.
   **Explanation of refactoring:** Method is divided into multiple methods to 
reduce the cyclomatic complexity.
   
   ### Decompose conditional
   **Class:** org.apache.pdfbox.io.MemoryUsageSetting
   **Reason for refactoring:** Complex Conditional - The conditional expression 
locUseMainMemory && (locMaxStorageBytes > -1) && ((locMaxMainMemoryBytes == -1) 
|| (locMaxMainMemoryBytes > locMaxStorageBytes)) is complex.
   **Explanation of refactoring:** Introduced new methods for conditional logic.
   
   ### Introduce explaining variable
   **Class:** org.apache.pdfbox.io.IOUtils
   **Reason for refactoring:** Long Statement
   1. The length of the statement "final MethodHandle 
nonNullTest=lookup.findStatic(Objects.class,"nonNull",methodType(boolean.class,Object.class)).asType(methodType(boolean.class,cleanerClass));"
 is 160.
   2. The length of the statement "final MethodHandle 
unmapper=filterReturnValue(directBufferCleanerMethod,guardWithTest(nonNullTest,cleanMethod,noop)).asType(methodType(void.class,ByteBuffer.class));"
 is 165.
   
   **Explanation of refactoring:** Complicated expressions are replaced by 
explaining variables.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to