<commit_before>// Models to store and control data

const DATA_PROVIDERS_URL = "https://raw.githubusercontent.com/neoranga55/bitcoin-price-ticker/refactor-to-use-firefox-frames/data/data-providers.json";
const DEFAULT_TICKER_CSS_CLASSES = "ticker";
var tickers = { "models": {}, "views": {}, "controllers": {}};
var tickersRepository = {};
var preLoadtickersRepository = {};

// Load configuration of data providers from JSON

function loadJSON(url) {
  $.getJSON(url, function(json) {
      tickersRepository = json;
      for (var id in preLoadtickersRepository) { 
        updateTickerConfiguration(id, preLoadtickersRepository[id]);
      }
  })
}

loadJSON(DATA_PROVIDERS_URL);

function getTickerModel(id, data, observer) {
  var tickerModel = tickers["models"][id];
  if (tickerModel) {
    updateTickerModelConfiguration(tickerModel, data);
  } else {
    tickerModel = createAndConfigureTickerModel(id, data, observer);
  }
  return tickerModel;
}

function createAndConfigureTickerModel(id, data, observer) {
  var tickerModel = createTickerModel(id);<commit_msg>Fix static analysis errors<commit_after>// Models to store and control data

const DATA_PROVIDERS_URL = "https://raw.githubusercontent.com/neoranga55/bitcoin-price-ticker/refactor-to-use-firefox-frames/data/data-providers.json";
const DEFAULT_TICKER_CSS_CLASSES = "ticker";
var tickers = { "models": {}, "views": {}, "controllers": {}};
var tickersRepository = {};
var preLoadtickersRepository = {};

// Load configuration of data providers from JSON

function loadJSON(url) {
  $.getJSON(url, function(json) {
      tickersRepository = json;
      for (var id in preLoadtickersRepository) {
        if (preLoadtickersRepository.hasOwnProperty(id)) {
          updateTickerConfiguration(id, preLoadtickersRepository[id]);
        }
      }
  })
}

loadJSON(DATA_PROVIDERS_URL);

function getTickerModel(id, data, observer) {
  var tickerModel = tickers["models"][id];
  if (tickerModel) {
    updateTickerModelConfiguration(tickerModel, data);
  } else {
    tickerModel = createAndConfigureTickerModel(id, data, observer);
  }
  return tickerModel;
}

function createAndConfigureTickerModel(id, data, observer) {
  var tickerModel = createTickerModel(id);
{'fraction_non_alphanumeric': 0.11978465679676985, 'fraction_numerical': 0.001794526693584567, 'mean_word_length': 4.930851063829787, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2709629', 'n_tokens_mistral': 710, 'n_tokens_neox': 701, 'n_words': 140}