Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 23,731
    • Issues 23,731
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 831
    • Merge Requests 831
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Packages
    • Packages
    • Container Registry
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #12656

Closed
Open
Opened Jul 05, 2019 by Virjinia Alexieva@valexieva
  • Report abuse
  • New issue
Report abuse New issue

Code complexity - Indentation Heuristic

Problem to solve

After we identify code hotspots, we would like to understand how complex the code is there since we might have perfectly good code that just needs to be broken down. A simple metric that correlates with McCabe Cyclomatic Complexity and Halstead complexity measures is indentation.

Intended users

EMs

Further details

Proposal

  • Use indentation in a file, i.e. count the tabs (or 4 spaces as one unit) on each line, ignoring empty lines/ comment lines
  • Get statistics such as the min, average, variance and max in a file
  • Change in indentation between revisions of the file, i.e. the trend I would suggest for the information to be reflected in a line chart, next to the code hotspots in Code Analytics, since we would like to see trends.

I would suggest a charts: On the x-axis, we can have the day the commits to master happened, while on the y-axis the mean amount of namespaces with 1 std deviation, sort of like Bollinger bands.

High std deviation means that there are portions of the code that probably should be reviewed.

We would like to connect the trends to what we see in terms of what people are working on - if we are seeing a lot of refactoring, we expect the complexity to go down with time - @valexieva to decide how to do this.

The calc should be done on master.

Permissions and Security

Documentation

Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Links / references

Edited Jul 07, 2019 by Virjinia Alexieva

Related issues

  • Discussion
  • Designs
Assignee
Assign to
Backlog
Milestone
Backlog
Assign milestone
Time tracking
None
Due date
None
11
Labels
Category:Code Analytics Enterprise Edition GitLab Premium Manage [DEPRECATED] UX analytics devops::manage feature group::analytics product discovery [DEPRECATED] workflow::problem validation
Assign labels
  • View project labels
Reference: gitlab-org/gitlab#12656