/config.rb (dca71f919a34986ed60ac3716f1bfbfab3535464) (3308 bytes) (mode 100644) (type blob)

require 'redis'
require 'ostruct'


CONFIG = OpenStruct.new

CONFIG.node_index_key        = 'all_nodes'
CONFIG.metric_index_key      = 'all_metrics'
CONFIG.score_index_key       = 'all_scores'

CONFIG.node_neighbors_prefix = 'node_neighbors:'
CONFIG.node_prefix           = 'node_metrics:'
CONFIG.metric_prefix         = 'metric:'
CONFIG.score_prefix          = 'score:'
CONFIG.statistics_prefix     = 'statistics:'

CONFIG.normalization_suffix  = '_normalized'

CONFIG.statistical_indicators = { 'min'                 => "Minimum",
                                  'max'                 => "Maximum",
                                  'average'             => "Average Value" ,
                                  'median'              => "Mean Value",
                                  'standard_deviation'  => "Standard Deviation"}

CONFIG.redis = Redis.new

#automatic retrieval and naive naming of available metrics from Redis
CONFIG.metric_names = CONFIG.redis.smembers(CONFIG.metric_index_key).inject({}) do |h,metric|
  h[metric] = metric.split('_').map(&:capitalize).join(' ')
  h
end


#CONFIG.metric_names = {
#  'clustering_coefficient'                      => "Clustering Coefficient",
#  'corrected_clustering_coefficient'            => "Clustering Coefficient (Corrected)",
#  'degree'                                      => "Node Degree",
#  'average_neighbor_degree'                     => "Average Neighbor Degree",
#  'corrected_average_neighbor_degree'           => "Average Neighbor Degree (Corrected)",
#  'iterated_average_neighbor_degree'            => "Iterated Average Neighbor Degree",
#  'corrected_iterated_average_neighbor_degree'  => "Iterated Average Neighbor Degree (Corrected)",
#  'betweenness_centrality'                      => "Betweenness Centrality",
#  'eccentricity'                                => "Eccentricity",
#  'average_shortest_path_length'                => "Average Shortest Path Length"
#}


#automatic retrieval and naive naming of available scores from Redis
CONFIG.score_names = CONFIG.redis.smembers(CONFIG.score_index_key).inject({}) do |h,score|
  h[score] = score.split('_').map(&:capitalize).join(' ')
  h
end


# scores have to be readable in redis
#CONFIG.score_names = {
#  'unified_risk_score'                => "Unified Risk Score (URS)",
#  'advanced_unified_risk_score'       => "Advanced URS"
#}


# css classes for status indication ordered from "good" to "bad"
CONFIG.color_classes = ['success','info', 'warning', 'danger']

#HTML color codes from green to red in 0x11-steps
CONFIG.color_codes = ['#FF0000','#FF1100','#FF2200','#FF3300','#FF4400',
                      '#FF5500','#FF6600','#FF7700','#FF8800','#FF9900',
                      '#FFAA00','#FFBB00','#FFCC00','#FFDD00','#FFEE00',
                      '#FFFF00','#EEFF00','#DDFF00','#CCFF00','#BBFF00',
                      '#AAFF00','#99FF00','#88FF00','#77FF00','#66FF00',
                      '#55FF00','#44FF00','#33FF00','#22FF00','#11FF00',
                      '#00FF00'].reverse

#can be metric or score
CONFIG.node_coloring_field = 'unified_risk_score'

# max number of neighbors for graphical representation with d3.js
CONFIG.max_graph_neighbors = 150
CONFIG.nodes_per_page = 25


Mode Type Size Ref File
100644 blob 32 02d771bb174550ee73ca245d5452a371c7ff568e Gemfile
100644 blob 71 5a0b34f4c7ea7ff499826db4642432a1e5940c5d Gemfile.lock
100644 blob 79 04e9bf5219f1065f2d2f20519a988f41a274d7d9 README.md
100644 blob 494 9eca68213c93af98fde713132b619df2393bbd39 color_helper.rb
100644 blob 3308 dca71f919a34986ed60ac3716f1bfbfab3535464 config.rb
100644 blob 79 a0f1048216dced361915ebb3a955fb637a7d5261 index.rb
100644 blob 516 1a41081b6d3d16270f8dfd81376d618d0c75c8ce metric_routes.rb
100644 blob 1478 d0c06b59ee66ca2a428d516cbee4a234e1722a19 node_routes.rb
040000 tree - 1e469524090bb9e333f8dc410b41ecb1e2515d02 public
100644 blob 297 6ecd1cc330e5a4919db79dba4f90bdd3b73b63a3 run.rb
100644 blob 450 c0946e5e0b88e95fa7a705b1e0c18e031b9b6c2b score_routes.rb
100644 blob 423 f981916c8eceac7fc69aeb01c3f2128f7def40f5 statistics_routes.rb
100644 blob 5608 5939518153061fe23d7baefd876e15dad4df2594 storage.rb
040000 tree - ff59ff6ca204b1b5cf166aab50055785f550cf03 views
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/coria/coria-backend

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/coria/coria-backend

Clone this repository using git:
git clone git://git.rocketgit.com/user/coria/coria-backend

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main