# groovydre:S134 FP with Jenkinsfile

**URL:** <https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524>\
**Category:** Report False-positive / False-negative...\
**Tags:** groovy\
**Created:** [October 26, 2026, 2:58pm UTC](https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524 "2026-10-26T14:58:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jilles-sg](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jilles-sg/32/63285_2.png) [@jilles-sg](https://community.sonarsource.com/u/jilles-sg)\
**Post date:** [October 26, 2026, 2:58pm UTC](https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524/1 "2026-10-26T14:58:50Z")

</div>

- What language is this for? Groovy
- Which rule? S134
- Why do you believe it’s a false-positive/false-negative? Pretty much any “declarative pipeline” Jenkinsfile has four levels of nesting before reaching the actual executable code, which is already more than the three allowed by the rule’s default configuration, and it is desirable to allow one or two levels within the executable code. A “scripted pipeline” Jenkinsfile starts out with two levels, but likely has more nested structures inside that.
- Are you using  
SonarQube Cloud
- How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)  
Sample declarative pipeline from the Jenkins documentation at [Creating your first Pipeline](https://www.jenkins.io/doc/pipeline/tour/hello-world/) :

```groovy
pipeline {
    agent { docker { image 'maven:3.10.0-eclipse-temurin-21-alpine' } }
    stages {
        stage('build') {
            steps {
                sh 'mvn --version'
            }
        }
    }
}

```

Sample scripted pipeline:

```groovy
node {
    stage('Build') {
        docker.image('maven:3.10.0-eclipse-temurin-21-alpine').inside {
            sh 'mvn --version'
        }
    }
}

```

I’m not sure about the best solution, but I’d like to write Jenkinsfiles without receiving warnings from S134, without modifying any Sonar configuration.

---

<div class="post-metadata">

**Author:** ![Wiebke](https://avatars.discourse-cdn.com/v4/letter/w/eb8c5e/32.png) [@Wiebke](https://community.sonarsource.com/u/Wiebke)\
**Post date:** [November 4, 2026, 10:52am UTC](https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524/3 "2026-11-04T10:52:29Z")

</div>

I agree. Same problem on our side.

The rule is talking about Control flow statements “if”, “for”, “while”, “switch” and “try” but it counts “pipeline”, “stages”, “stage”, “steps”.. as well as “node”, “timeout”, “stage”, … and none of these is really increasing complexity.

The behavior leads to having this issue in every pipeline.

---

<div class="post-metadata">

**Author:** ![sebastien.marichal](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sebastien.marichal/32/69045_2.png) [@sebastien.marichal](https://community.sonarsource.com/u/sebastien.marichal)\
**Post date:** [November 10, 2026, 3:21pm UTC](https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524/6 "2026-11-10T15:21:01Z")

</div>

Hello @jilles-sg and @Wiebke,

Thank you for reaching out.

I agree with both of you, this rule should not count expected Jenkins nested blocks.

I have added a ticket in our internal backlog to fix it. It should be available in the next release of the analyzer.

Have a good day!

---

<div class="post-metadata">

**Author:** ![Wiebke](https://avatars.discourse-cdn.com/v4/letter/w/eb8c5e/32.png) [@Wiebke](https://community.sonarsource.com/u/Wiebke)\
**Post date:** [November 11, 2026, 9:06am UTC](https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524/10 "2026-11-11T09:06:42Z")

</div>

Hi @sebastien.marichal ,

Thank you for taking this into account.

Will the solution be that the rule will ignore a fixed hardcoded set of expected blocks? Or will it be possible to at least add individual blocks for exclusion in some configuration field?

Option two would be preferred by us 🙂

Regards, Wiebke

---

<div class="post-metadata">

**Author:** ![sebastien.marichal](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/sebastien.marichal/32/69045_2.png) [@sebastien.marichal](https://community.sonarsource.com/u/sebastien.marichal)\
**Post date:** [November 11, 2026, 9:20am UTC](https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524/11 "2026-11-11T09:20:02Z")

</div>

Hello @Wiebke,

As for now, we have a set of hardcoded expected blocks.

Your suggestion seems legitimate, could you tell me a bit more why a set of hardcoded blocks won’t suit your needs?

I am not fluent in Jenkins and I would to understand your needs regarding this to ensure we can provide the best experience for you.

Thanks,

---

<div class="post-metadata">

**Author:** ![Wiebke](https://avatars.discourse-cdn.com/v4/letter/w/eb8c5e/32.png) [@Wiebke](https://community.sonarsource.com/u/Wiebke)\
**Post date:** [November 11, 2026, 9:49am UTC](https://community.sonarsource.com/t/groovydre-s134-fp-with-jenkinsfile/190524/12 "2026-11-11T09:49:48Z")

</div>

Hello @sebastien.marichal

I just thought that it might be a bit more comfortable if we could adapt the exception list to our needs. E.g. if new expected blocks are introduced by a jenkins update and the installed sonar version does not support it yet.

There might also be examples/reasons that we want to exclude additional statements from the complexity check which are not keywords from Jenkins.

Regards, Wiebke
