Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7843595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:35:37+00:00 2026-06-02T16:35:37+00:00

In Sonar, for a particular Java class, I see : Complexity: 830 Complexity /method:

  • 0

In Sonar, for a particular Java class, I see :

Complexity:     830

Complexity /method:     8,1

How could you explain the difference between those two metrics ?

Is “Complexity” the class complexity ?

What is the maximum complexity a class should be under ? I know methods should be less than 10 for method complexity, but what is the maximum class complexity number a class should conform to be considered not complex ?

Thanks.

EDIT

I also look at Cyclomatic-Complexity rule violations in the file.

For a number of methods, sonar says with different complexity numbers (in french) :

“La complexité cyclomatique de la classe est de 28 alors que le maximum autorisé est de 10.”

in english :

“The class cyclomatic complexity is 28 but the maximum allowed is 10”.

I don’t understand why it says “class cyclomatic complexity” as it seems as a “method cyclomatic complexity”.

Also, the class in question does not appears on top of the most complex class sorted by average complexity/method, as sonar says it has only 8,1 average method complexity.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:35:39+00:00Added an answer on June 2, 2026 at 4:35 pm

    You can have a look at our “Metric Definitions” Wiki page (and more specifically on the “Complexity” section) to know more about the meaning of metrics found in Sonar.

    • “Complexity” is the total complexity of a resource (for a file => sum of the complexities of every class defined in the file)
    • “Complexity / method” is the “Complexity” divided by the number of methods found in the file
    • … and so on for the other metrics.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running sonar from Jenkins. I want to exclude some java files in
I am using maven to build my java app, Jenkins for CI and Sonar
I would like to create two sets of Sonar reports from the same project.
This could be a duplicate of Installing Sonar and Jenkins on Tomcat , if
Environment: hudson/sonar/maven2 in ubuntu locally with default parameters And I got the log from
Ok I am using Sonar to check code quality. It's telling me this simple
I am creating a plugin for Sonar and I need to create a custom
i've got a problem with an sonar analysis trought maven. in my pom.xml i
When I do the local analysis in sonar eclipse plugin, I'm getting the following
I have a custom defined table in sonar DB , and I wanted to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.