Showing 113 of 173 total issues
Method accept
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void accept(final Dependency dep, final Path path) {
try {
MojoExecutor.executeMojo(
MojoExecutor.plugin(
Method deps
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private Collection<Dependency> deps() {
Iterable<Dependency> deps = new DcsDefault(
this.scopedTojos(),
this.discoverSelf,
this.skipZeroVersions
Method transpile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private int transpile(final ForeignTojo tojo) throws IOException {
final Path file;
try {
file = tojo.verified();
} catch (final AttributeNotFoundException exception) {
Method shift
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Bytes shift(final int bits) {
// @checkstyle MethodBodyCommentsCheck (3 lines)
// @checkstyle NestedIfDepthCheck (40 lines)
final byte[] bytes = this.take();
Method get
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public String get() {
final String result;
switch (this.data.length) {
case 0:
Method exec
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void exec() throws IOException {
if (this.offline) {
Logger.info(
this,
Method file
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private Path file(final Dependency origin) {
try {
final String name = DcsDepgraph.fileName(origin);
MojoExecutor.executeMojo(
MojoExecutor.plugin(
Method execWithTimeout
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.CloseResource")
private void execWithTimeout() throws ExecutionException, TimeoutException {
final ExecutorService service = Executors.newSingleThreadExecutor();
try {
service.submit(
Method exitError
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void exitError(final String msg, final Throwable exp)
throws MojoFailureException {
if (!this.unrollExitError) {
return;
}
Method take
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public <T> T take(final Class<T> type) {
final byte[] weak = this.take();
final Object strong;
if (type.equals(Long.class)) {
strong = new BytesOf(weak).asNumber(Long.class);
- 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 toPhi
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
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)) {
- 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 probes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private Collection<ObjectName> probes(final Path file) throws FileNotFoundException {
final Collection<ObjectName> objects = new ListOf<>(
new Mapped<>(
obj -> new OnCached(
new OnSwap(
Method iterator
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Iterator<Dependency> iterator() {
final Collection<Dependency> deps = new ListOf<>(this.delegate.iterator());
final Map<String, Set<String>> conflicts = deps
.stream()
Method exec
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
void exec() {
final Collection<ForeignTojo> tojos = this.scopedTojos().withXmir();
final int total = new OptimizedTojos(
new Filtered<>(
Method failures
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("unchecked")
public Collection<String> failures() throws IOException {
final Yaml yaml = new Yaml();
final Map<String, Object> map = yaml.load(this.script);
final String src = map.get("eo").toString();
Method φTerm
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public String φTerm() {
final List<String> list = new ArrayList<>(this.attrs.size());
final String format = "%s ↦ %s";
if (this.data.get() != null) {
Method makeGraph
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void makeGraph(final String xembly, final Path sodg) throws IOException {
if (this.generateGraphFiles) {
final Directives all = new Directives(xembly);
Logger.debug(
this, "There are %d Xembly directives for %s",
Method load
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("unchecked")
private static ConcurrentHashMap<String, String> load(final Path src) throws IOException {
try (ObjectInputStream map = new ObjectInputStream(
new ByteArrayInputStream(
Base64.getDecoder().decode(
Method keepThem
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.AvoidAccessToStaticMembersViaThis")
private int keepThem(final Iterable<? extends PlacedTojo> tojos) throws IOException {
int deleted = 0;
int remained = 0;
for (final PlacedTojo tojo : tojos) {
Method lambda
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Phi lambda() throws Exception {
final String locator = this.take("code").locator().split(":")[0];
final String name = Optional.ofNullable(NAMES.get(locator))
.orElseThrow(() -> new ExNative("No native function for %s", locator));