Skip to content

Commit

Permalink
feat: Remove all QODANA rules and corresponding tests (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt committed Jan 14, 2024
1 parent d43f2aa commit fcdde5b
Show file tree
Hide file tree
Showing 88 changed files with 396 additions and 3,497 deletions.
4 changes: 0 additions & 4 deletions code-transformation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ plugins {
}

jar {
manifest {
// attributes "Main-Class": "xyz.keksdose.spoon.code_solver.TransformationEngine"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
Expand All @@ -24,7 +21,6 @@ dependencies {
implementation "com.contrastsecurity:java-sarif:+"
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.25.1'
implementation project(":commons")
implementation project(":spoon-analyzer")
implementation 'io.github.java-diff-utils:java-diff-utils:4.12'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,28 @@

import io.github.martinwitt.laughing_train.domain.entity.AnalyzerResult;
import java.nio.file.Path;
import java.util.List;
import spoon.reflect.cu.SourcePositionHolder;
import spoon.reflect.declaration.CtType;
import spoon.reflect.declaration.CtTypeParameter;
import xyz.keksdose.spoon.code_solver.history.ChangeListener;
import xyz.keksdose.spoon.code_solver.transformations.BadSmell;
import xyz.keksdose.spoon.code_solver.transformations.CodeIssue;

/**
* This defines a refactoring of a reported {@link AnalyzerResult}. With the help of this class, the
* refactoring can be applied to the source code. The refactoring is applied by calling the {@link
* #refactor(ChangeListener,CtType)} method.
*/
public abstract class AbstractRefactoring {

protected AnalyzerResult result;

/**
* Creates a new refactoring with a given result.
*
* @param result the result of an analysis run.
*/
protected AbstractRefactoring(AnalyzerResult result) {
this.result = result;
}

/**
* Applies the refactoring to the given {@link CtType}.
*
* @param listener The listener which is used to report the changes.
* @param type The type which contains the reported bad smell.
*/
public abstract void refactor(ChangeListener listener, CtType<?> type);
public abstract void refactor(ChangeListener listener, CtType<?> type, AnalyzerResult result);

/**
* Returns a list of all {@link BadSmell}s which are refactored by this refactoring.
* Returns the handled bad smells by the implementing class.
*
* @return A list of all {@link BadSmell}s which are refactored by this refactoring. Never null.
* @return the handled bad smells
*/
public abstract List<BadSmell> getHandledBadSmells();
public abstract CodeIssue getHandledBadSmells();

/**
* Checks if the given {@link CtType} is the type which contains the reported bad smell.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package xyz.keksdose.spoon.code_solver.analyzer;

import io.github.martinwitt.laughing_train.domain.value.RuleId;
import xyz.keksdose.spoon.code_solver.transformations.CodeIssue;

public interface AnalyzerRule {

RuleId getRuleId();
RuleId ruleId();

CodeIssue description();
}

This file was deleted.

Loading

0 comments on commit fcdde5b

Please sign in to comment.