Sonarscanner skipping ... as it uses a not-yet-supported language feature:

Hi, we use Devops pipelines for CI/CD.
I followed the tutorial on the sonarcloud website, to add the correct yaml. I use CLI scannermode.
The code that should be analysed is Python code.

As of right now, all 3 steps complete, prepare, analyse and publish. On Sonarcloud itself I can see that a PR has been analysed, but there is nothing filled in.

I enabled debug mode of the scanner to get more of an idea what went wrong.

All files I’m trying to scan, are present. indicated by: 08:34:04.113 INFO: 16 source files to be analyzed

A few lines later these start to appear for 1000+ lines:
08:34:05.757 DEBUG: Skipping function fxf_setup_teardown at file /mnt/data/agents/agent_4/_work/1/_test/ as it uses a not-yet-supported language feature: Decorated function
08:34:05.769 DEBUG: Expression NameImpl has been translated to unknown-expression function call.
08:34:05.791 DEBUG: Skipping statement AssertStatementImpl.

Every function gets skipped, since all of them start with either @ pytest… or contain at least assert somewhere. These errors make it look like it is not possible to analyse Python code using these features.

Other not implemented yet: BreakStatementImpl, TryStatementImpl, both of which are fairly common used features

My question now is, are these errors a result of me simply not configuring something correctly, or are these really not implemented into the scanner yet? If so, are these planned to be added, and when.

Thanks for your help!

Hey there.

Take a look at this post.

So I would suggest you don’t pay attention to these messages, as they’re just indicating that some rules don’t support these language features. They don’t indicate that they aren’t being scanned at all.

Have you changed anything else in the PR other than these configuration files? The PR analysis will only show changed lines of changed files in the PR.

1 Like

That makes sense. This PR was created to test the analysis and indeed contains the same files as our develop branch. I will try this. Thanks for your explanation!

Well it seems that it worked after all, report of the pr with info is now available in
I’m new to this sonar related stuff, so your help is much appreciated :smiley: !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.