Showing 198 of 403 total issues
Method searchInText
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private boolean searchInText(final String text, final HitConsumer hitConsumer){
Objects.requireNonNull(text, "Text cannot be null");
boolean found = false;
if(isInitialized()){
- 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 morphologicalFieldCheck
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void morphologicalFieldCheck(final Inflection inflection, final int index){
if(!inflection.hasMorphologicalFields())
EventBusService.publish(new LinterWarning(NO_MORPHOLOGICAL_FIELD, inflection.getWord())
.withIndex(index));
- 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 grow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void grow(){
IntBlock lastDataBlock = blocks[indexOfLastDataBlock];
//if the last Block is full, we need to make a new Block
if(lastDataBlock.isFull()){
- 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 validateAugmentedRule
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static void validateAugmentedRule(final CharSequence cleanedRule, final String rule){
final int count = RegexHelper.clear(cleanedRule, PATTERN_HYPHENATION_POINT).length();
if(count != 1)
throw new LinterException(MORE_HYPHENATION_DOTS, rule);
- 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 compare
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@Override
public int compare(final byte[] left, final byte[] right){
final int stride = 8;
final int minLength = Math.min(left.length, right.length);
final int strideLimit = minLength & -stride;
- 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 remove
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public final synchronized void remove(){
final IntBlock lastNonEmptyDataBlock = blocks[indexOfLastNonEmptyDataBlock];
lastNonEmptyDataBlock.shrink();
size --;
- 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 readCharacters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static Set<String> readCharacters(final Scanner scanner, final int numEntries) throws EOFException{
final Set<String> wordBreakCharacters = new HashSet<>(numEntries);
for(int i = 0; i < numEntries; i ++){
ParserHelper.assertNotEOF(scanner);
- 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 sort
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static <T> void sort(final T[] data, final int low, final int high, final Comparator<? super T> comparator,
final ProgressCallback progressCallback){
Objects.requireNonNull(data, "Data cannot be null");
Objects.requireNonNull(comparator, "Comparator cannot be null");
assert low < high && low < data.length && high <= data.length;
- 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 combineMorphologicalFields
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public final List<String> combineMorphologicalFields(final DictionaryEntry dicEntry){
final List<String> baseMorphFields = (dicEntry.morphologicalFields != null? new ArrayList<>(dicEntry.morphologicalFields):
new ArrayList<>(0));
final List<String> ruleMorphFields = (morphologicalFields != null? morphologicalFields: new ArrayList<>(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 containsTriple
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static boolean containsTriple(final StringBuffer sb, final String compound){
boolean repeated = false;
final int size = sb.length() - 1;
if(size > 1){
final String interCompounds = sb.substring(Math.max(size - 1, 0), size + 1)
- 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 compactInflections
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static LineEntry compactInflections(final List<LineEntry> rules){
if(rules.size() > 1){
//retrieve rule with the longest condition (all the other conditions must be this long)
LineEntry maxConditionEntry = null;
int maxConditionLength = 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 haveIdenticalGlyphs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static boolean haveIdenticalGlyphs(final Font font, final float maxDifferenceThreshold, final char... chrs){
final BufferedImage[] glyphs = new BufferedImage[chrs.length];
glyphs[0] = renderImage(font, chrs[0]);
for(int i = 0; i < chrs.length - 1; i ++)
for(int j = i + 1; j < chrs.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 manageInside
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static void manageInside(final Map<Integer, IndexDataPair<String>> indexesAndRules, final List<String> syllabes,
final CharSequence nohyp, final int wordLength){
final int nohypLength = nohyp.length();
int index = 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 emitArc
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private int emitArc(final OutputStream os, final int flags, final byte label, final int targetOffset) throws IOException{
int length = 0;
final int labelIndex = invertedLabelsIndex[label & 0xFF];
if(labelIndex > 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 parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public final void parse(final ParsingContext context) throws EOFException{
final Scanner scanner = context.getScanner();
if(!NumberUtils.isCreatable(context.getFirstParameter()))
throw new LinterException(BAD_FIRST_PARAMETER, context);
final int numEntries = Integer.parseInt(context.getFirstParameter());
- 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 retrieveAdditionsToBeRemoved
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static List<String> retrieveAdditionsToBeRemoved(final Collection<LineEntry> rules, final LineEntry rule,
final Collection<LineEntry> temporaryRules, final Map<String, List<String>> lcss, final List<String> keys){
final List<String> additionsToBeRemoved = new ArrayList<>(0);
for(int i = 0; i < keys.size(); i ++){
final String key = keys.get(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 browse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("UseOfProcessBuilder")
public static boolean browse(File file) throws IOException, InterruptedException{
if(file.isFile())
file = 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 determineCharset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static Charset determineCharset(final Path path, final int limitLinesRead){
String fileCharsetName = null;
for(final Charset cs : HUNSPELL_CHARSETS){
try(final BufferedReader reader = Files.newBufferedReader(path, cs)){
if(fileCharsetName == 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 checkValidity
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private void checkValidity(final AffixType parentType, final AffixType type, final String parentFlag, final String flag,
final String removal, final String line, final int index){
Avoid deeply nested control flow statements. Open
for(int k = j + 1; k < properChildrenSize; k ++)
if(!SetHelper.intersection(childrenGroup.get(properChildren.get(j)), childrenGroup.get(properChildren.get(k))).isEmpty())
//TODO
throw new IllegalStateException("Children are not disjointed, please report this case to the developer, thank you");