Showing 198 of 403 total issues
Method isProductiveFor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final boolean isProductiveFor(final String word){
if(entries != null)
for(int i = 0; i < entries.size(); i ++)
if(entries.get(i).canApplyTo(word))
return true;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method extractFileList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static List<String> extractFileList(final File projectFolder, final File[] excludeFolderBut){
final List<File> exclusions = new ArrayList<>(excludeFolderBut.length);
for(final File file : excludeFolderBut)
if(file != null)
exclusions.add(file.getParentFile());
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method matchesAny
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static boolean matchesAny(final Path input, final Iterable<PathMatcher> patterns){
if(patterns != null)
for(final PathMatcher pattern : patterns)
if(matches(input, pattern))
return true;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method extractInflection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void extractInflection(final List<String> suffixInflection, final ByteBuffer output){
if(suffixInflection != null)
for(int i = 0; i < suffixInflection.size(); i ++){
final String[] tags = InflectionTag.createFromCodeAndValue(suffixInflection.get(i)).getTags();
for(int j = 0; j < tags.length; j ++)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method mergeSort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void mergeSort(final Queue<BinaryFileBuffer> queue, final boolean removeDuplicates, final BufferedWriter writer,
final String lineSeparator) throws IOException{
String lastLine = null;
while(!queue.isEmpty()){
final BinaryFileBuffer buffer = queue.poll();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method containsAffixes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static boolean containsAffixes(final List<String> amf, final MorphologicalTag[] tags){
for(final MorphologicalTag tag : tags)
for(final String elem : amf)
if(tag.isSupertypeOf(elem))
return true;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method executeDesktopCommand
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("ConstantConditions")
private static boolean executeDesktopCommand(final Desktop.Action action, final Object parameter){
boolean done = false;
final Desktop desktop = getDesktopFor(action);
try{
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method extractOwnCodeStackTrace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static StackTraceElement extractOwnCodeStackTrace(final Throwable t){
final StackTraceElement[] stackTrace = t.getStackTrace();
StackTraceElement stackTrace0 = null;
if(stackTrace.length > 0){
final String className = ExceptionHelper.class.getName();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method dispatchToVetoableHandlers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private boolean dispatchToVetoableHandlers(final Object evt, final Collection<HandlerInfoCallable> vetoHandlers){
//used to keep track if a veto was called (if so, the regular list won't be processed)
boolean vetoCalled = false;
//submit the veto calls to the executor service
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method concatenate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static byte[] concatenate(final byte[]... arrays){
int size = 0;
for(int i = 0; i < arrays.length; i ++)
size += (arrays[i] != null? arrays[i].length: 0);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method classifyCasing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static Casing classifyCasing(final CharSequence text){
if(StringUtils.isBlank(text))
return Casing.LOWER_CASE;
final long upper = text.chars()
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method extractChildren
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static List<Node> extractChildren(final Node parentNode, final Predicate<Node> extractionCondition){
final ArrayList<Node> children = new ArrayList<>(0);
if(parentNode != null){
final NodeList nodes = parentNode.getChildNodes();
final int length = nodes.getLength();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method createInnerProcessorBySize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private BiConsumer<IndexDataPair<String>, Long> createInnerProcessorBySize(
final Consumer<IndexDataPair<String>> dataProcessor, final long fileSize){
final AtomicLong progress = new AtomicLong(1);
final AtomicInteger progressIndex = new AtomicInteger(1);
final int progressStep = (int)Math.ceil(fileSize / 100.f);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method loadFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("OverlyBroadThrowsClause")
private List<IndexDataPair<String>> loadFile(final Path path, final Charset charset) throws IOException{
//read entire file in memory
final List<String> lines = Files.readAllLines(path, charset);
if(!workerData.isNoHeader())
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Boolean call(){
try{
final Object subscriber = handlerInfo.getSubscriber();
if(subscriber == null){
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method extractMaxScoreIndices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private Deque<IndexDataPair<Integer>> extractMaxScoreIndices(final double maxScore){
//collect max scores:
final Deque<IndexDataPair<Integer>> maxScores = new ArrayDeque<>();
for(int j = 1; j <= m; j ++)
for(int i = 1; i <= n; i ++)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public final void run(){
if(watcher == null)
return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method processLinesSequentialByLine
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("OverlyBroadThrowsClause")
private void processLinesSequentialByLine(final Path path, final Charset charset, final Consumer<IndexDataPair<String>> dataProcessor)
throws IOException{
//read entire file in memory
final List<String> lines = FileHelper.readAllLines(path, charset);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"