Showing 198 of 403 total issues
Method prepareTextForFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static Pair<String, String> prepareTextForFilter(final String[] partOfSpeeches, final String[] synonyms){
//extract Part-of-Speech if present
final String posFilter = (partOfSpeeches != null && partOfSpeeches.length > 0
? "[\\(\\s](" + StringUtils.join(partOfSpeeches, PIPE) + ")[\\),]"
: ".+");
- 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 validateBasicRules
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static void validateBasicRules(final CharSequence rule){
if(!RegexHelper.find(rule, PATTERN_VALID_RULE))
throw new LinterException(INVALID_RULE, rule);
if(!StringUtils.contains(rule, EQUALS_SIGN)){
if(!RegexHelper.find(rule, PATTERN_VALID_RULE_BREAK_POINTS))
- 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 contains
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public final boolean contains(final T value){
if(value != null)
for(final BloomFilterInterface<T> filter : filters)
if(filter.contains(value))
- 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 replaceAll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final void replaceAll(final Collection<String> c, final int startIndex){
if(!c.isEmpty()){
final int size = getSize();
if(startIndex >= size)
addAll(c);
- 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 freezeState
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private int freezeState(final int activePathIndex){
final int start = activePath[activePathIndex];
final int end = nextArcOffset[activePathIndex];
final int length = end - start;
- 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 checkCompoundValidity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static void checkCompoundValidity(final String[] parts, final CharSequence compoundRule){
for(final String part : parts){
final int size = part.length();
final boolean isFlag = (size != 1
|| !FlagParsingStrategy.FLAG_OPTIONAL.equals(part) && !FlagParsingStrategy.FLAG_ANY.equals(part));
- 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 enforceOnlyInCompound
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void enforceOnlyInCompound(final Iterable<Inflection> inflections){
final String onlyInCompoundFlag = affixData.getOnlyInCompoundFlag();
if(onlyInCompoundFlag != 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"
Further reading
Method parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("OverlyBroadThrowsClause")
public final void parse(final File theFile) throws IOException{
clear();
final Path thePath = theFile.toPath();
- 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 clear
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final void clear(){
totalInflections = 0;
longestWordCountByCharacters = 0;
longestWordCountBySyllabes = 0;
lengthsFrequencies.clear();
- 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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
@SuppressWarnings({"unused", "NumberEquality"})
public final void initialize(final Integer actionCommand){
if(actionCommand != MainFrame.ACTION_COMMAND_INITIALIZE)
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 existsCompoundAsReplacement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private boolean existsCompoundAsReplacement(final String word){
boolean exists = false;
for(final String elem : compoundAsReplacement)
if(word.contains(elem)){
exists = 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 clear
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final void clear(){
secondLevelPresent = false;
patternNoHyphen = null;
patterns.clear();
for(final Level lev : Level.values()){
- 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 mergeThesaurusRow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final void mergeThesaurusRow(final Component invoker){
final int selectedRow = table.convertRowIndexToModel(table.getSelectedRow());
final ThesaurusTableModel dm = (ThesaurusTableModel)table.getModel();
final ThesaurusEntry synonyms = dm.getSynonymsAt(selectedRow);
final SynonymsEntry newSynonyms = new SynonymsEntry(synonymsTextField.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 containsPartOfSpeechesAndSynonym
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final boolean containsPartOfSpeechesAndSynonym(final List<String> partOfSpeeches, final String synonym){
if(synonyms != null)
for(int i = 0; i < synonyms.size(); i ++){
final SynonymsEntry entry = synonyms.get(i);
if(entry.hasSamePartOfSpeeches(partOfSpeeches) && entry.containsSynonym(synonym))
- 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 contains
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final boolean contains(final Collection<String> partOfSpeeches, final List<String> synonyms){
final Collection<String> ss = new ArrayList<>(synonyms);
final boolean removed = ss.remove(definition);
if(removed)
for(int i = 0; i < this.synonyms.size(); 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 add
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final boolean add(final String[] partOfSpeeches, final String[] synonyms){
final StringJoiner sj = new StringJoiner(LIST_SEPARATOR, PART_OF_SPEECH_START, PART_OF_SPEECH_END);
final int size = (partOfSpeeches != null? partOfSpeeches.length: 0);
for(int i = 0; i < size; i ++)
sj.add(partOfSpeeches[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 validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final void validate(){
if(getExpectedNumberOfElements() <= 0)
throw new IllegalArgumentException(INVALID_NUMBER_OF_ELEMENTS);
if(getFalsePositiveProbability() <= 0. || getFalsePositiveProbability() >= 1.)
throw new IllegalArgumentException(INVALID_FALSE_POSITIVE_PROBABILITY);
- 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 insertRuleOrUpdateFrom
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static void insertRuleOrUpdateFrom(final List<LineEntry> expandedRules, final LineEntry rule){
final int ruleIndex = expandedRules.indexOf(rule);
if(ruleIndex >= 0)
expandedRules.get(ruleIndex).from.addAll(rule.from);
else{
- 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 getMinimumFromLength
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public final int getMinimumFromLength(){
int minLength = -1;
for(final String f : from){
final int length = f.length();
if(length < minLength || minLength < 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 siftDown
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static <T> void siftDown(final T[] data, final int low, final int heapsize, final Comparator<? super T> comparator){
//index of the element being moved down the tree
int parent = low;
int leftChild;
do{
- 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"