Showing 113 of 173 total issues
Method killThem
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.CognitiveComplexity")
private int killThem(final Iterable<PlacedTojo> all) throws IOException {
int unplaced = 0;
for (final PlacedTojo tojo : all) {
final String related = tojo.related();
- 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 validateComment
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void validateComment(
final ParserRuleContext ctx,
final List<EoParser.CommentContext> comments
) {
if(this.tests || comments.isEmpty()) {
Method exec
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void exec() {
final List<Path> errors = new ListOf<>();
final Home home = new HmBase(this.unphiOutputDir);
final Iterable<Directive> metas = new UnphiMojo.Metas(this.unphiMetas);
Method killThem
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.CognitiveComplexity")
private int killThem(final Iterable<PlacedTojo> all) throws IOException {
int unplaced = 0;
for (final PlacedTojo tojo : all) {
final String related = tojo.related();
Method execute
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
@SuppressWarnings("PMD.CognitiveComplexity")
public final void execute() throws MojoFailureException {
StaticLoggerBinder.getSingleton().setMavenLog(this.getLog());
if (this.skip) {
Method exitError
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private void exitError(final String msg, final Throwable exp)
throws MojoFailureException {
if (!this.unrollExitError) {
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 exec
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void exec() throws IOException {
if (this.generateGraphFiles && !this.generateXemblyFiles) {
throw new IllegalStateException(
"Setting generateGraphFiles and not setting generateXemblyFiles has no effect because .graph files require .xe files"
- 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 exec
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void exec() {
if (this.sourcesDir == null) {
throw new IllegalArgumentException(
String.format("sourcesDir is null. Please specify a valid sourcesDir for %s", this)
Method exec
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void exec() {
if (this.central == null) {
this.central = new Central(this.project, this.session, this.manager);
}
Method iterator
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Iterator<Dependency> iterator() {
final Collection<ForeignTojo> list = this.tojos.dependencies();
Logger.debug(
this, "%d suitable tojo(s) found out of %d",
Method exec
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
void exec() throws IOException {
final Home home = new HmBase(this.printOutputDir);
final int total = new SumOf(
new Threads<>(
Method exec
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void exec() {
if (this.central == null) {
this.central = new Central(this.project, this.session, this.manager);
}
Method write
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
void write(final int identifier, final int offset, final byte[] data) {
synchronized (this.blocks) {
if (!this.blocks.containsKey(identifier)) {
throw new ExFailure(
String.format(
Method toPhi
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Phi toPhi(final Object obj) {
final Phi phi;
final Phi eolang = Phi.Φ.take("org").take("eolang");
if (obj instanceof Boolean) {
if (obj.equals(true)) {
Method iterator
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Iterator<Dependency> iterator() {
try {
final Collection<Dependency> all = new ArrayList<>(0);
if (Files.exists(this.file)) {
Method exec
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void exec() {
if (this.central == null) {
this.central = new Central(this.project, this.session, this.manager);
}
- 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 validateComment
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private void validateComment(
final ParserRuleContext ctx,
final List<EoParser.CommentContext> comments
) {
if(this.tests || comments.isEmpty()) {
- 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 render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private int render(final Path xmir, final Path sodg) throws IOException {
final XML before = new XMLDocument(xmir);
if (Logger.isTraceEnabled(this)) {
Logger.trace(this, "XML before translating to SODG:\n%s", before);
}
Method generate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void generate() throws IOException {
final String code = RustNode.unhex(this.node.xpath("@code").get(0));
final List<String> dependencies =
this.node.xpath("./dependencies/dependency/attribute(name)")
Method artifact
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Optional<Dependency> artifact(final Path file) {
final Collection<String> coords;
try {
coords = new XMLDocument(file).xpath(
"//meta[head='rt' and part[1]='jvm']/part[2]/text()"