Showing 198 of 403 total issues
Method letterToFlagCompatibilityCheck
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final void letterToFlagCompatibilityCheck(final Inflection inflection){
final String word = inflection.getWord();
for(int i = 0; i < letterAndRulesCombinableKeys.length; i ++)
if(!StringUtils.containsAny(word, letterAndRulesCombinableKeys[i])){
final LetterMatcherEntry[] letterMatcherEntries = letterAndRulesCombinable.get(letterAndRulesCombinableKeys[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 match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final void match(final Inflection inflection){
if(!inflection.getContinuationFlags().isEmpty())
for(int i = 0; i < wrongFlags.length; i ++)
if(inflection.hasContinuationFlag(wrongFlags[i]))
throw new LinterException(messagePattern, masterFlag, wrongFlags[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 intersects
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final boolean intersects(final Collection<String> partOfSpeeches, final String[] synonyms){
final Collection<String> ss = new ArrayList<>(List.of(synonyms));
final boolean removed = ss.remove(definition);
for(int i = 0; i < this.synonyms.size(); i ++){
final SynonymsEntry entry = this.synonyms.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 removeTwofolds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void removeTwofolds(final Iterable<Inflection> prods){
final String circumfixFlag = affixData.getCircumfixFlag();
if(circumfixFlag != null){
final Iterator<Inflection> itr = prods.iterator();
while(itr.hasNext()){
- 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 limitComboBoxActionPerformed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void limitComboBoxActionPerformed(final java.awt.event.ActionEvent evt) {//GEN-FIRST:event_limitComboBoxActionPerformed
final String inputText = ((String)inputComboBox.getEditor().getItem()).trim();
final int limit = Integer.parseInt(limitComboBox.getItemAt(limitComboBox.getSelectedIndex()));
final String inputCompounds = inputTextArea.getText();
- 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 expandAndRehash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void expandAndRehash(){
final int[] newHashSet = new int[(hashSet.length << 1)];
final int bucketMask = (newHashSet.length - 1);
for(final int state : hashSet)
if(state > 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 linearizeState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void linearizeState(final FSAAbstract fsa, final DynamicIntArray nodes, final DynamicIntArray linearized,
final IntSet visited, final int node){
linearized.add(node);
visited.add(node);
for(int arc = fsa.getFirstArc(node); arc != 0; arc = fsa.getNextArc(arc))
- 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 equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public final boolean equals(final Object obj){
if(this == obj)
return true;
if(obj == null || getClass() != obj.getClass())
- 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 reverse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final LineEntry reverse(){
final String reversedRemoval = StringUtils.reverse(removal);
final Collection<String> reversedAddition = new HashSet<>(addition.size());
final Collection<String> reversedFrom = new HashSet<>(from.size());
final StringBuilder sb = new StringBuilder();
- 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 containsSynonym
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final boolean containsSynonym(final String synonym){
if(synonyms != null)
for(int i = 0; i < synonyms.size(); i ++)
if(ThesaurusDictionary.removeSynonymUse(synonyms.get(i)).equals(synonym))
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 addRuleButtonActionPerformed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void addRuleButtonActionPerformed(final java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addRuleButtonActionPerformed
final String newRule = addRuleTextField.getText();
final HyphenationParser.Level level = HyphenationParser.Level.values()[addRuleLevelComboBox.getSelectedIndex()];
final String foundRule = parserManager.addHyphenationRule(newRule.toLowerCase(Locale.ROOT), level);
if(foundRule == 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 searchInText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final void searchInText(final String text, final HitProcessor<V> processor){
Objects.requireNonNull(processor, "Processor cannot be null");
final HitConsumer consumer = (hits, index) -> {
final int position = index + 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 removeRule
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final boolean removeRule(final String rule, final Level level){
final String oldRule;
if(isCustomRule(rule)){
final String key = StringHelper.removeAll(rule, EQUALS_SIGN);
oldRule = customHyphenations.get(level)
- 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 insertSynonyms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final DuplicationResult<ThesaurusEntry> insertSynonyms(final String partOfSpeechAndSynonyms,
final Predicate<String> duplicatesDiscriminator){
final String[] posAndSyns = StringUtils.split(partOfSpeechAndSynonyms, ThesaurusEntry.PART_OF_SPEECH_SEPARATOR, 2);
if(posAndSyns.length != 2)
throw new LinterException(WRONG_FORMAT, partOfSpeechAndSynonyms);
- 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 equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public final boolean equals(final Object obj){
if(this == obj)
return true;
if(obj == null || getClass() != obj.getClass())
- 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 match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final void match(final Inflection inflection){
if(!inflection.getContinuationFlags().isEmpty())
for(int i = 0; i < wrongFlags.length; i ++)
if(inflection.hasContinuationFlag(wrongFlags[i]))
throw new LinterException(messagePattern, masterLetter, wrongFlags[i], correctRule);
- 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 insertCorrection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final DuplicationResult<CorrectionEntry> insertCorrection(final String incorrect, final String correct,
final BooleanSupplier duplicatesDiscriminator){
if(incorrect.contains(HyphenationParser.APOSTROPHE) || incorrect.contains(QUOTATION_MARK))
throw new LinterException(BAD_QUOTE, "Incorrect", incorrect);
if(correct.contains(HyphenationParser.APOSTROPHE) || correct.contains(QUOTATION_MARK))
- 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 expandAddition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void expandAddition(final List<LineEntry> rules, final LineEntry compactedRule){
final String from = rules.get(0).from.iterator().next();
final int longestConditionLength = compactedRule.condition.length();
for(int i = 0; i < rules.size(); i ++){
final LineEntry rule = rules.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 withEquivalentChars
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public final DictionaryMetadataBuilder withEquivalentChars(final Map<Character, List<Character>> equivalentChars){
final StringBuilder builder = new StringBuilder();
for(final Map.Entry<Character, List<Character>> e : equivalentChars.entrySet()){
final Character k = e.getKey();
for(final Character v : e.getValue()){
- 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 enforceCircumfix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void enforceCircumfix(final Iterable<Inflection> inflections){
final String circumfixFlag = affixData.getCircumfixFlag();
if(circumfixFlag != null){
final Iterator<Inflection> itr = inflections.iterator();
while(itr.hasNext()){
- 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"