<commit_before>require 'neoid'
require 'active_record'
require 'neography'
require 'rest-client'
require 'codeclimate-test-reporter'
require 'factory_girl'
require 'rspec/its'

CodeClimate::TestReporter.start

require 'simplecov'

require "factories.rb"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
]

SimpleCov.start

uri = URI.parse('http://localhost:7474')
$neo = Neography::Rest.new(uri.to_s)

Neography.configure do |c|
  c.server = uri.host
  c.port = uri.port

  if uri.user && uri.password
    c.authentication = 'basic'
    c.username = uri.user
    c.password = <PASSWORD>
  end
end

Neoid.db = $neo

Neoid.configure do |config|
  config.enable_subrefs = false
end
<commit_msg>run code climate if environment variable provided<commit_after>require 'neoid'
require 'active_record'
require 'neography'
require 'rest-client'
require 'codeclimate-test-reporter'
require 'factory_girl'
require 'rspec/its'

CodeClimate::TestReporter.start if ENV['CODECLIMATE_REPO_TOKEN']

require 'simplecov'

require "factories.rb"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
]

SimpleCov.start

uri = URI.parse('http://localhost:7474')
$neo = Neography::Rest.new(uri.to_s)

Neography.configure do |c|
  c.server = uri.host
  c.port = uri.port

  if uri.user && uri.password
    c.authentication = 'basic'
    c.username = uri.user
    c.password = <PASSWORD>
  end
end

Neoid.db = $neo

Neoid.configure do |config|
  config.enable_subrefs = false
end

{'fraction_non_alphanumeric': 0.12234385061171925, 'fraction_numerical': 0.0051513200257566, 'mean_word_length': 4.954022988505747, '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': '3263664', 'n_tokens_mistral': 551, 'n_tokens_neox': 541, 'n_words': 114}