Skip to content

Conversation

pynicolas
Copy link
Contributor

No description provided.

@benzonico benzonico changed the title Migrate FieldNameCheck to strongly typed AST SONARPY-394 Migrate FieldNameCheck to strongly typed AST Sep 24, 2019
import org.sonar.python.parser.PythonParser;
import org.sonar.python.tree.PythonTreeMaker;

public class SemanticTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is factorization by inheritance, I would rather make this a utility class with a static method.

}
});
scopesByRootTree.values().stream()
.filter(scope -> scope.rootTree instanceof PyClassDefTree)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use of .is(Tree.Kind.CLASSDEF) ?

'project:twisted-12.1.0/twisted/internet/task.py':[
63,
64,
112,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this issue is missing and not relevant anymore : this is an instance field and should be detected as such.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I figured it out : this self variable is instantiated via a class method. This is way out of scope of this sprint, so fine to accept this "loss" for now.

hashicorp-vault-sonar-prod bot pushed a commit that referenced this pull request Jul 29, 2025
…es analysis (#360)

GitOrigin-RevId: 673c28b6ac4ed5db19430d57872a5a02fec1b594
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

Successfully merging this pull request may close these issues.

3 participants