objectionary/eo

View on GitHub

Showing 118 of 187 total issues

Method deps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

private Collection<Dep> deps() {
Dependencies deps = new DpsDefault(
this.scopedTojos(), this.discoverSelf, this.skipZeroVersions, this.resolveJna
);
if (this.ignoreRuntime) {
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/ResolveMojo.java - About 35 mins to fix

Method main has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public static void main(final String... args) throws Exception {
Main.setup();
final List<String> opts = new ArrayList<>(args.length);
opts.addAll(Arrays.asList(args));
while (!opts.isEmpty()) {
Severity: Minor
Found in eo-runtime/src/main/java/org/eolang/Main.java - About 35 mins to fix

Method safeMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

@SuppressWarnings("PMD.AvoidCatchingGenericException")
private static String safeMessage(final Phi enclosure) {
String result;
if (enclosure == null) {
result = "null Phi";
Severity: Minor
Found in eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java - About 35 mins to fix

Method reset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private static XML reset(final XML xml, final Path tmp) {
final Optional<String> location = new Xnav(xml.inner())
.element("program")
.attribute("xsi:noNamespaceSchemaLocation")
.text();
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/StrictXmir.java - About 25 mins to fix

Method execWithTimeout has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@SuppressWarnings("PMD.CloseResource")
private void execWithTimeout() throws ExecutionException, TimeoutException {
final ExecutorService service = Executors.newSingleThreadExecutor();
try {
service.submit(
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/SafeMojo.java - About 25 mins to fix

Method pinfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private void pinfo(final Path java, final String oname, final String pname)
throws IOException {
final Path pinfo = java.getParent().resolve("package-info.java");
if (!pinfo.toFile().exists() && !pname.isEmpty()) {
if (pinfo.getParent().toFile().mkdirs()) {
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java - About 25 mins to fix

Method printLogInfoAboutBinary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private void printLogInfoAboutBinary(final Path file) {
final Path target = PlaceMojo.this.outputDir.toPath().resolve(
this.dir.relativize(file)
);
final Optional<TjPlaced> tojo = PlaceMojo.this.placedTojos.find(target);
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/PlaceMojo.java - About 25 mins to fix

Method summary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private static String summary(final ConcurrentHashMap<Severity, Integer> counts) {
final List<String> parts = new ArrayList<>(0);
final int criticals = counts.get(Severity.CRITICAL);
if (criticals > 0) {
parts.add(LintMojo.plural(criticals, "critical error"));
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/LintMojo.java - About 25 mins to fix

Method exec has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@Override
public void exec() {
final long begin = System.currentTimeMillis();
String before = this.scopedTojos().status();
int cycle = 0;
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java - About 25 mins to fix

Method enterCompactArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@Override
public void enterCompactArray(final EoParser.CompactArrayContext ctx) {
final int count;
if (ctx.INT() != null) {
final String num = ctx.INT().getText();
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/XeEoListener.java - About 25 mins to fix

Method delta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@Override
public byte[] delta() {
final byte[] bytes;
if (this.data.isPresent()) {
bytes = this.data.get();
Severity: Minor
Found in eo-runtime/src/main/java/org/eolang/PhDefault.java - About 25 mins to fix

Method get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@Override
public String get() {
final String hex;
if (this.bytes.length == 0) {
hex = "--";
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/BytesToHex.java - About 25 mins to fix

Method artifact has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private static Optional<Dep> artifact(final Path file) {
final Collection<String> coords = DpsDefault.jvms(file);
if (coords.size() > 1) {
throw new IllegalStateException(
Logger.format("Too many (%d) dependencies at %[file]s", coords.size(), file)
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/DpsDefault.java - About 25 mins to fix

Method cleanPlace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private Path cleanPlace(final Path dir, final String version) throws IOException {
final File[] subs = dir.toFile().listFiles();
if (subs != null) {
for (final File sub : subs) {
final String base = sub.getName();
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/ResolveMojo.java - About 25 mins to fix

Method enterData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@Override
@SuppressWarnings("PMD.ConfusingTernary")
public void enterData(final EoParser.DataContext ctx) {
final Supplier<String> data;
final String base;
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/XeEoListener.java - About 25 mins to fix

Method impasse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private static String impasse(final Parser parser) {
final String rule = parser.getRuleInvocationStack().get(0);
final String[] names = parser.getRuleNames();
final String detailed;
if (names[EoParser.RULE_objects].equals(rule)) {
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/EoParserErrors.java - About 25 mins to fix

Method exec has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@Override
public void exec() throws IOException {
final List<Path> all = new Walk(this.classesDir.toPath()).stream()
.filter(
file -> this.includes.stream().anyMatch(
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnspileMojo.java - About 25 mins to fix

Method initField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
private void initField(
final Class<?> clazz,
final AbstractMojo mojo,
final Map.Entry<String, Object> entry
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/Moja.java - About 25 mins to fix
Severity
Category
Status
Source
Language