Showing 198 of 403 total issues
Method buildMaxHeap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private static <T> void buildMaxHeap(final T[] data, final int low, final int high, final Comparator<? super T> comparator,
final int progressStep, final ProgressCallback progressCallback){
Method maxRepeating
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static int maxRepeating(final CharSequence text, final char chr){
final int n = text.length();
int count = 0;
int currentCount = 1;
//traverse string except last character
- 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 forEachDictionaryLine
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static void forEachDictionaryLine(final File file, final Charset charset, final BiConsumer<Integer, String> fun,
final ProgressCallback progressCallback){
final int totalLines = FileHelper.getLinesCount(file, charset);
int progress = 0;
int progressIndex = 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
Avoid deeply nested control flow statements. Open
for(final AffixEntry otherAppliedRule : other.getInflection().getAppliedRules())
otherAppliedRules.remove(otherAppliedRule.getFlag());
Avoid deeply nested control flow statements. Open
if(candidateAppliedRules.isEmpty()){
final String info = candidate.getWord()
+ (equalProduction && ! other.getWord().equals(candidate.getWord())? " (or " + other.getWord() + ")": "")
+ " is a candidate for removal";
if(!sj.toString().endsWith(info))
Method readHunspellCharsetName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static String readHunspellCharsetName(final BufferedReader reader, final int limitLinesRead) throws IOException{
//scan each lines until either a valid charset name is found as the first line (hyphenation or thesaurus file),
//or `SET <charsetName>` is found (affix file)
int linesRead = 0;
while(limitLinesRead < 0 || linesRead < limitLinesRead){
- 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
Consider simplifying this complex logical expression. Open
if(appliedRules.length > 0){
//check that last suffix and last prefix don't have the needaffix flag
boolean lastSuffix = false;
boolean lastPrefix = false;
boolean lastSuffixNeedAffix = false;
Consider simplifying this complex logical expression. Open
if(hasLeadingZeros(tokens[0])
|| tokensWithPatch != null && (tokensWithPatch.length > 1 && hasLeadingZeros(tokens[1])
|| tokensWithPatch.length > 2 && hasLeadingZeros(tokensWithPatch[2])))
throw new IllegalArgumentException("Numeric identifier MUST NOT contain leading zeros");
Method getListCellRendererComponent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public final Component getListCellRendererComponent(final JList<? extends String> list, final String value, final int lineIndex,
final boolean isSelected, final boolean cellHasFocus){
Method replace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public final void replace(final FilterBypass fb, final int offset, final int length, final String text, final AttributeSet attrs) throws BadLocationException{
Method emitArcs
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private boolean emitArcs(final FSAAbstract fsa, final OutputStream os, final int[] linearized, final int gtl, final int nodeDataLength)
Method linearizeState
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static void linearizeState(final FSAAbstract fsa, final DynamicIntArray nodes, final DynamicIntArray linearized,
final IntSet visited, final int node){
Method applyAffixRule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private List<Inflection> applyAffixRule(final DictionaryEntry dicEntry, final String affix, final List<String> postponedAffixes,
final boolean isCompound, final RuleEntry overriddenRule) throws NoApplicableRuleException{
Method retrieveAdditionsToBeRemoved
has 5 arguments (exceeds 4 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){
Method createPopupMenu
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected JPopupMenu createPopupMenu(final boolean properties, final boolean copy, final boolean save, final boolean print,
final boolean zoom){
Method createDictionaryStatistics
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public final void createDictionaryStatistics(final BooleanSupplier preStart, final Consumer<WorkerAbstract<?>> onStart,
final Consumer<WorkerAbstract<?>> onEnd, final Consumer<Exception> onCancelled, final Frame parentFrame){
Method createWorker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static <T> void createWorker(final String workerName, final Function<T, WorkerAbstract<?>> creator, final Supplier<T> preStart,
final Consumer<WorkerAbstract<?>> onStart, final Consumer<WorkerAbstract<?>> onEnd){
Method encode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static byte[] encode(final byte[] inflectedWord, final ByteBuffer tag, final String stem, final byte separator,
final SequenceEncoderInterface sequenceEncoder){
Method sort
has 5 arguments (exceeds 4 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){
Method createWordlistWorker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public final void createWordlistWorker(final WordlistWorker.WorkerType type, final Supplier<File> preStart,
final Consumer<WorkerAbstract<?>> onStart, final Consumer<WorkerAbstract<?>> onEnd, final Consumer<Exception> onCancelled){