Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev-Issue #97

Open
MartinWitt opened this issue Sep 5, 2022 · 51 comments
Open

Dev-Issue #97

MartinWitt opened this issue Sep 5, 2022 · 51 comments

Comments

@MartinWitt
Copy link
Owner

No description provided.

@MartinWitt
Copy link
Owner Author

@laughing-train mining

29 similar comments
@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

9 similar comments
@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train mining

@MartinWitt
Copy link
Owner Author

@laughing-train list

@laughing-train
Copy link
Contributor

Bad smells

I found 0 bad smells:

1 similar comment
@laughing-train
Copy link
Contributor

Bad smells

I found 0 bad smells:

@MartinWitt
Copy link
Owner Author

@laughing-train list

@laughing-train
Copy link
Contributor

Bad smells

I found 0 bad smells:

@MartinWitt
Copy link
Owner Author

@laughing-train list

2 similar comments
@MartinWitt
Copy link
Owner Author

@laughing-train list

@MartinWitt
Copy link
Owner Author

@laughing-train list

@laughing-train
Copy link
Contributor

Bad smells

I found 10 bad smells:

UnnecessaryToStringCall

Unnecessary toString() call
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/qodana/CollectionEmptyCheck.java

Snippet

        CtType<?> parent = element.getParent(CtType.class).getTopLevelType();
        String raw = "Replaced " + element + " with " + innvocation.toString();
        String markdown = "Replaced `" + element + "` with `" + innvocation.toString() + "`";
        setChanged(parent, new Change(COLLECTION_EMPTY_CHECK, MarkdownString.fromMarkdown(raw, markdown), parent));
    }

UnnecessaryToStringCall

Unnecessary toString() call
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/qodana/rules/UnnecessaryToStringCall.java

Snippet

        for (CtInvocation<?> toStringInvocations : type.getElements(new InvocationFilter(toStringMethod))) {
            if (isAlmostMatch(toStringInvocations)) {
                String oldInvocation = "" + toStringInvocations.toString();
                toStringInvocations.replace(toStringInvocations.getTarget());
                toStringInvocations

UnnecessaryToStringCall

Unnecessary toString() call
in github-bot/src/main/java/io/github/martinwitt/laughing_train/App.java

Snippet

            TransformationEngine transformationEngine = new TransformationEngine(List.of(function));
            transformationEngine.setChangeListener(changeListener);
            System.out.println("refactorRepo: " + dir.toString() + "/" + config.getSrcFolder());
            transformationEngine.applyToGivenPath(dir.toString() + "/" + config.getSrcFolder());
        } catch (Exception e) {

UnnecessaryToStringCall

Unnecessary toString() call
in github-bot/src/main/java/io/github/martinwitt/laughing_train/App.java

Snippet

            transformationEngine.setChangeListener(changeListener);
            System.out.println("refactorRepo: " + dir.toString() + "/" + config.getSrcFolder());
            transformationEngine.applyToGivenPath(dir.toString() + "/" + config.getSrcFolder());
        } catch (Exception e) {
            logger.atSevere().withCause(e).log("Failed to refactor repo");

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertFalseSameCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertFalse(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertNullTransformation.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertTrue(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertNotNullTransformation.java

Snippet

    public void process(CtInvocation<?> element) {
        if (element.getExecutable() != null && JunitHelper.isJunit5AssertTrue(element.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = element;
            CtExpression<?> expression = element.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertTrueSameCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertTrue(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertFalseEqualsCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertFalse(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtInvocation) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertTrueEqualsCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertTrue(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtInvocation) {

@MartinWitt
Copy link
Owner Author

@laughing-train list

@laughing-train
Copy link
Contributor

Bad smells

I found 10 bad smells:

UnnecessaryToStringCall

Unnecessary toString() call
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/qodana/CollectionEmptyCheck.java

Snippet

        CtType<?> parent = element.getParent(CtType.class).getTopLevelType();
        String raw = "Replaced " + element + " with " + innvocation.toString();
        String markdown = "Replaced `" + element + "` with `" + innvocation.toString() + "`";
        setChanged(parent, new Change(COLLECTION_EMPTY_CHECK, MarkdownString.fromMarkdown(raw, markdown), parent));
    }

UnnecessaryToStringCall

Unnecessary toString() call
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/qodana/rules/UnnecessaryToStringCall.java

Snippet

        for (CtInvocation<?> toStringInvocations : type.getElements(new InvocationFilter(toStringMethod))) {
            if (isAlmostMatch(toStringInvocations)) {
                String oldInvocation = "" + toStringInvocations.toString();
                toStringInvocations.replace(toStringInvocations.getTarget());
                toStringInvocations

UnnecessaryToStringCall

Unnecessary toString() call
in github-bot/src/main/java/io/github/martinwitt/laughing_train/App.java

Snippet

            TransformationEngine transformationEngine = new TransformationEngine(List.of(function));
            transformationEngine.setChangeListener(changeListener);
            System.out.println("refactorRepo: " + dir.toString() + "/" + config.getSrcFolder());
            transformationEngine.applyToGivenPath(dir.toString() + "/" + config.getSrcFolder());
        } catch (Exception e) {

UnnecessaryToStringCall

Unnecessary toString() call
in github-bot/src/main/java/io/github/martinwitt/laughing_train/App.java

Snippet

            transformationEngine.setChangeListener(changeListener);
            System.out.println("refactorRepo: " + dir.toString() + "/" + config.getSrcFolder());
            transformationEngine.applyToGivenPath(dir.toString() + "/" + config.getSrcFolder());
        } catch (Exception e) {
            logger.atSevere().withCause(e).log("Failed to refactor repo");

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertFalseSameCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertFalse(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertNullTransformation.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertTrue(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertNotNullTransformation.java

Snippet

    public void process(CtInvocation<?> element) {
        if (element.getExecutable() != null && JunitHelper.isJunit5AssertTrue(element.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = element;
            CtExpression<?> expression = element.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertTrueSameCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertTrue(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtBinaryOperator) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertFalseEqualsCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertFalse(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtInvocation) {

UnnecessaryLocalVariable

Local variable junit5AssertTrue is redundant
in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/transformations/junit/simplification/AssertTrueEqualsCheck.java

Snippet

    public void process(CtInvocation<?> invocation) {
        if (invocation.getExecutable() != null && JunitHelper.isJunit5AssertTrue(invocation.getExecutable())) {
            CtInvocation<?> junit5AssertTrue = invocation;
            CtExpression<?> expression = invocation.getArguments().iterator().next();
            if (expression instanceof CtInvocation) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant