uartois / sonar-golang

Sonarqube plugin for the golang language.
GNU Lesser General Public License v3.0
245 stars 32 forks source link

How to change value of cyclomatic complexity? #68

Closed dieuhd closed 6 years ago

dieuhd commented 6 years ago

I want to change value of cyclomatic complexity from 10 to 30.

    <rule>
        <key>gocyclo:CyclomaticComplexity</key>
        <name>Cyclomatic complexity is high</name>
        <internalKey>gocyclo:CyclomaticComplexity</internalKey>
        <description><![CDATA[<p>The cyclomatic complexity is greater than 10</p>]]>

        </description>
        <severity>MAJOR</severity>
        <cardinality>SINGLE</cardinality>
        <status>READY</status>
        <type>CODE_SMELL</type>
        <tag>complexity</tag>
        <remediationFunction>CONSTANT_ISSUE</remediationFunction>
        <remediationFunctionBaseEffort>10min</remediationFunctionBaseEffort>
    </rule>

How to do it?

Thanks

thibaultfalque commented 6 years ago

Hi, The plugin use the gometalinter. It's not directly the plugin that generate the issues, the plugin read the report of issues generated by gometalinter.

So if you want change the cyclomatic complexity you must use the -over option of the linter gocyclo, but I don't know how use this option with gometalinter.

thibaultfalque commented 6 years ago

@dieuhd could you close this issue if the problem is resolved ?

dieuhd commented 6 years ago

Resolved. I modifyed code of golint https://github.com/golang/lint.