         requestStatus()
       )
 
+  # Request the status of issued jobs
   requestStatus = () ->
     $.getJSON('/metrics/status', processStatus)
 
+  # Processes the JSON-encoded job progress results
   processStatus = (response) ->
     for repository, metrics of response
       for metric, job of metrics
-        type = determineBarType(job)
-        if type?
-          progressClass = '.admin.control.progress'
-          repositoryId = repository.split('.').join('-')
-          barDiv = $("#{progressClass} .#{repositoryId}.#{metric}.#{type}.bar")
-          barDiv.css('width', "#{job.percent}%")
-          if type == 'compute'
-            barDiv = $("#{progressClass} .#{repositoryId}.#{metric}.analyze.bar")
-            barDiv.css('width', "100%")
-
+        displayJobProgress(repository, metric, job)
 
     if repeatRequest(response)
       setTimeout(requestStatus, 500)
 
+  # Visualizes the job progresses
+  displayJobProgress = (repository, metric, job) ->
+    type = determineBarType(job)
+    if type?
+      fillProgressBar(repository, metric, type, job.percent)
+      if type == 'compute'
+        fillProgressBar(repository, metric, 'analyze', '100%')
+
+  # Determines progress bar element that need change based on the
+  # current job state
   determineBarType = (job) ->
     type = null
     types = ['analyze', 'compute']

      type = job.state
    return type

  repeatRequest = (response) ->
    for repository, metrics of response
      for metric, job of metrics

$ ->

  # Adds to each compute button a callback event
  initializeButtons = () ->
    for metric in gon.metrics
      repository = gon.repository.name
      $(".compute-metric.#{metric}").click createRequestCallback(repository, metric)

  # Create the callback used for the metric button click handler
  createRequestCallback = (repository, metric) ->
