]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 Add characteristic criterion
authorStas Vilchik <vilchiks@gmail.com>
Fri, 21 Mar 2014 11:12:56 +0000 (17:12 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 21 Mar 2014 11:12:56 +0000 (17:12 +0600)
sonar-server/src/main/webapp/coffee/coding-rules/app.coffee
sonar-server/src/main/webapp/coffee/coding-rules/mockjax.coffee
sonar-server/src/main/webapp/coffee/coding-rules/views/filters/characteristic-filter-view.coffee [new file with mode: 0644]

index 5c68e21642954c490925809d3ae1efd7db041d02..cf6400cfdfd83a9cdeb045b4a7ce6e1d9521668a 100644 (file)
@@ -39,6 +39,7 @@ requirejs [
   'navigator/filters/date-filter-view',
   'coding-rules/views/filters/quality-profile-filter-view',
   'coding-rules/views/filters/inheritance-filter-view',
+  'coding-rules/views/filters/characteristic-filter-view',
 
   'coding-rules/mockjax',
   'common/handlebars-extensions'
@@ -64,6 +65,7 @@ requirejs [
   DateFilterView,
   QualityProfileFilterView,
   InheritanceFilterView
+  CharacteristicFilterView
 ) ->
 
   # Create a generic error handler for ajax requests
@@ -230,6 +232,13 @@ requirejs [
       type: ChoiceFilters.ChoiceFilterView
       choices: @tags
 
+    @filters.add new BaseFilters.Filter
+      name: t 'coding_rules.filters.characteristic'
+      property: 'characteristic'
+      type: CharacteristicFilterView
+      choices: @characteristics
+      multiple: false
+
     @activeInFilter = new BaseFilters.Filter
       name: t 'coding_rules.filters.in_quality_profile'
       property: 'in_quality_profile'
@@ -237,7 +246,6 @@ requirejs [
       multiple: false
     @filters.add @activeInFilter
 
-
     @filters.add new BaseFilters.Filter
       name: t 'coding_rules.filters.key'
       property: 'key'
@@ -324,6 +332,7 @@ requirejs [
       App.repositories = r.repositories
       App.statuses = r.statuses
       App.tags = r.tags
+      App.characteristics = r.characteristics
       window.messages = r.messages
 
       # Remove the initial spinner
index 5eda25095c47aaec6d4033a7f7de6b9e4d62fec4..a668b743579f8642879d24b5b41ec665ce9398f7 100644 (file)
@@ -42,6 +42,46 @@ define ['jquery.mockjax'], ->
         'size': 'size'
         'unused': 'unused'
         'unused-code': 'unused-code'
+      characteristics:
+        '1469': 'Changeability'
+        '1441': 'Changeability: Architecture related changeability'
+        '1470': 'Changeability: Data related changeability'
+        '1475': 'Changeability: Logic related changeability'
+        '1392': 'Efficiency'
+        '1377': 'Efficiency: Memory use'
+        '2965': 'Efficiency: Network use'
+        '1393': 'Efficiency: Processor use'
+        '1154': 'Maintainability'
+        '1022': 'Maintainability: Readability'
+        '1155': 'Maintainability: Understandability'
+        '988': 'Portability'
+        '977': 'Portability: Compiler related portability'
+        '989': 'Portability: Hardware related portability'
+        '994': 'Portability: Language related portability'
+        '1000': 'Portability: OS related portability'
+        '1006': 'Portability: Software related portability'
+        '1021': 'Portability: Time zone related portability'
+        '1551': 'Reliability'
+        '1496': 'Reliability: Architecture related reliability'
+        '1552': 'Reliability: Data related reliability'
+        '1596': 'Reliability: Exception handling'
+        '1622': 'Reliability: Fault tolerance'
+        '1629': 'Reliability: Instruction related reliability'
+        '1759': 'Reliability: Logic related reliability'
+        '2948': 'Reliability: Resource'
+        '1874': 'Reliability: Synchronization related reliability'
+        '1925': 'Reliability: Unit tests'
+        '975': 'Reusability'
+        '974': 'Reusability: Modularity'
+        '976': 'Reusability: Transportability'
+        '1345': 'Security'
+        '1335': 'Security: API abuse'
+        '1346': 'Security: Errors'
+        '1349': 'Security: Input validation and representation'
+        '1364': 'Security: Security features'
+        '1933': 'Testability'
+        '1932': 'Testability: Integration level testability'
+        '1934': 'Testability: Unit level testability'
       messages:
         'all': 'All'
         'any': 'Any'
@@ -98,6 +138,7 @@ define ['jquery.mockjax'], ->
         'coding_rules.select_tag': 'Select Tag'
 
         'coding_rules.filters.availableSince': 'Available Since'
+        'coding_rules.filters.characteristic': 'Characteristic'
         'coding_rules.filters.description': 'Description'
         'coding_rules.filters.in_quality_profile': 'In Quality Profile'
         'coding_rules.filters.inheritance': 'Inheritance'
diff --git a/sonar-server/src/main/webapp/coffee/coding-rules/views/filters/characteristic-filter-view.coffee b/sonar-server/src/main/webapp/coffee/coding-rules/views/filters/characteristic-filter-view.coffee
new file mode 100644 (file)
index 0000000..efa29a7
--- /dev/null
@@ -0,0 +1,12 @@
+define [
+  'navigator/filters/choice-filters'
+], (
+  ChoiceFilters
+) ->
+
+  class CharacteriticFilterView extends ChoiceFilters.ChoiceFilterView
+
+    initialize: ->
+      super
+      @choices.comparator = 'text'
+      @choices.sort()