Showing 118 of 209 total issues
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 get
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public String get() {
final String result;
switch (this.data.length) {
case 0:
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));
Method exec
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void exec() throws IOException {
final List<Path> all = new Walk(this.classesDir.toPath()).stream()
.filter(
file -> this.includes.stream().anyMatch(
Method parsed
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public XML parsed() throws IOException {
final XePhiListener xel = new XePhiListener(this.name);
final ParsingErrors spy = new ParsingErrors(this.input);
final PhiLexer lexer = new PhiLexer(
Method find
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public int find(final String name) {
if (name == null) {
throw new IllegalArgumentException(
"Argument name is null"
Method accept
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void accept(final Path sources, final Path destination) {
final String src = sources.toString();
final String dst = destination.toString();
try {
Method exec
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void exec() {
final Collection<ForeignTojo> tojos = this.scopedTojos().notDiscovered();
final Collection<String> discovered = new HashSet<>();
for (final ForeignTojo tojo : tojos) {
Method iterator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public Iterator<Dependency> iterator() {
final Collection<ForeignTojo> list = this.tojos.dependencies();
Logger.debug(
this, "%d suitable tojo(s) found out of %d",
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static boolean parse(final String opt) throws IOException {
if ("--verbose".equals(opt)) {
Main.EOLOG.setLevel(Level.FINE);
for (final Handler hnd : Main.EOLOG.getHandlers()) {
hnd.setLevel(Level.FINE);
Method attr
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private String attr(final int pos) {
if (0 > pos) {
throw new ExFailure(
String.format(
"Attribute position can't be negative (%d)",
Method load
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static ConcurrentHashMap<String, String> load(final String src) throws IOException {
try (ObjectInputStream map = new ObjectInputStream(
new ByteArrayInputStream(
Base64.getDecoder().decode(
Files.readAllBytes(Paths.get(src))
Method iterator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Iterator<Dependency> iterator() {
return new Mapped<>(
dependency -> {
final Iterable<Dependency> transitives = new Filtered<>(
Method unplaceClasses
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.AvoidAccessToStaticMembersViaThis")
private void unplaceClasses() throws IOException {
final Collection<PlacedTojo> classes = this.placedTojos.classes();
int deleted = 0;
if (!this.keepBinaries.isEmpty()) {
Method lambda
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Phi lambda() throws Exception {
final Path path = Paths.get(
new Dataized(
this.take(Attr.RHO).take("file").take("path")
Method exec
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void exec() {
final Collection<ForeignTojo> tojos = this.scopedTojos().withXmir();
final int total = new OptimizedTojos(
new Filtered<>(
Method exec
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void exec() throws IOException {
final Path target = this.outputDir.toPath().resolve(CopyMojo.DIR);
final Collection<Path> sources = new Walk(this.sourcesDir.toPath());
for (final Path src : sources) {
Method lambda
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Phi lambda() throws Exception {
final Phi regex = this.take(Attr.RHO);
final String expression = new Dataized(regex.take("expression")).asString();
if (!expression.startsWith("/")) {
Method exec
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
void exec() {
final Collection<ForeignTojo> tojos = this.scopedTojos().withOptimized();
final int total = new OptimizedTojos(
new Filtered<>(
Method failures
has a Cognitive Complexity of 9 (exceeds 5 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();
- 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"