<commit_before>var github = require('octonode');
var radar = require('../views/radar-impl');

var client = github.client('<KEY>');

function findByLanguage(language, data){
    for(var langObj in data){
        if(data[langObj].language === language){
          return langObj;
        }
    }
    return -1;
}

function crawlOrg(orgName, callback) {

  var ghOrg = client.org(orgName);
  var data = [];

  ghOrg.repos(function(err, body){
    console.log(err);
    for(var repo in body) {
      var currentLanguage = body[repo].language;
      if(currentLanguage === null) continue;

      var languageIndex = findByLanguage(currentLanguage, data);
      if( languageIndex !== -1){
        data[languageIndex].count = data[languageIndex].count + 1;
      } else {
        var newLanguage = {};
        newLanguage.language = currentLanguage;
        newLanguage.count = 1;
        data.push(newLanguage);
      }
    }
    callback(data);
  });
}

function crawlMembers(orgName, callback) {
  var data = [];
  var membersNames = [];
  client.org(orgName).members(function(err, members){

  for(var memberIndex in members) {
      membersNames.push(members[memberIndex].login);
    }

    console.log(membersNames);
    callback(data);
  });
}

module.exports = {
  render: function(orgName) {
      crawlOrg(orgName, function(orgData) {
        crawlMembers(orgName, function(memberData){
          radar.showRadar(orgData);
        })
    });
  }
};<commit_msg>testing for rob<commit_after>var github = require('octonode');
var radar = require('../views/radar-impl');

var client = github.client('<KEY>');

function findByLanguage(language, data){
    for(var langObj in data){
        if(data[langObj].language === language){
          return langObj;
        }
    }
    return -1;
}

function crawlOrg(orgName, callback) {

  var ghOrg = client.org(orgName);
  var data = [];

  ghOrg.repos(function(err, body){
    console.log(err);
    for(var repo in body) {
      var currentLanguage = body[repo].language;
      if(currentLanguage === null) continue;

      var languageIndex = findByLanguage(currentLanguage, data);
      if( languageIndex !== -1){
        data[languageIndex].count = data[languageIndex].count + 1;
      } else {
        var newLanguage = {};
        newLanguage.language = currentLanguage;
        newLanguage.count = 1;
        data.push(newLanguage);
      }
    }
    callback(data);
  });
}

function crawlMembers(orgName, callback) {
  var data = [];
  var membersNames = [];
  client.org(orgName).members(function(err, members){

  for(var memberIndex in members) {
      membersNames.push(members[memberIndex].login);
    }
    
    console.log(membersNames);
    callback(data);
  });
}

module.exports = {
  render: function(orgName) {
      crawlOrg(orgName, function(orgData) {
        crawlMembers(orgName, function(memberData){
          radar.showRadar(orgData);
        })
    });
  }
};
{'fraction_non_alphanumeric': 0.14051841746248295, 'fraction_numerical': 0.002728512960436562, 'mean_word_length': 2.9158878504672896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '7615351', 'n_tokens_mistral': 920, 'n_tokens_neox': 886, 'n_words': 174}