<commit_before>"""
file: analyze.py 
author: <NAME> <<EMAIL>>
date: November 2013
description: Base script to call. Looks at the Repository table for
repositories that need to be analyzed, analyzes it, and places 
results in the metrics table.
"""

import sys
from datetime import datetime, timedelta
from repository import *
from commit import *
from bugfinder import *
from metricsgenerator import *
from githubissuetracker import *
from caslogging import logging

logging.info('Starting CASAnalyzer')

# Latest time to analyze repo (1 Day)
refresh_date = str(datetime.utcnow() - timedelta(days=1))
session = Session()

reposToAnalyze = (session.query(Repository)
                  .filter( (Repository.analysis_date==None) |
                          (Repository.analysis_date < refresh_date)
                          )
                  .all()
                  )

# CHANGE WITH YOUR OWN VALUES
notifier = Notifier("GMAIL USER", "GMAIL PASSWORD")

if len(reposToAnalyze) > 0:
	for repo in reposToAnalyze:
		repo_name = repo.name
		repo_id = repo.id

		# Add if applicable subscriber
		notifier.addSubscribers(['<EMAIL>'])<commit_msg>Changed to import the notifier in analyze.py not in bugfinder.py<commit_after>"""
file: analyze.py 
author: <NAME> <<EMAIL>>
date: November 2013
description: Base script to call. Looks at the Repository table for
repositories that need to be analyzed, analyzes it, and places 
results in the metrics table.
"""

import sys
from datetime import datetime, timedelta
from repository import *
from commit import *
from bugfinder import *
from metricsgenerator import *
from githubissuetracker import *
from caslogging import logging
from notifier import *

logging.info('Starting CASAnalyzer')

# Latest time to analyze repo (1 Day)
refresh_date = str(datetime.utcnow() - timedelta(days=1))
session = Session()

reposToAnalyze = (session.query(Repository)
                  .filter( (Repository.analysis_date==None) |
                          (Repository.analysis_date < refresh_date)
                          )
                  .all()
                  )

# CHANGE WITH YOUR OWN VALUES
notifier = Notifier("GMAIL USER", "GMAIL PASSWORD")

if len(reposToAnalyze) > 0:
	for repo in reposToAnalyze:
		repo_name = repo.name
		repo_id = repo.id

		# Add if applicable subscriber
		notifier.addSubscribers(['<EMAIL>'])
{'fraction_non_alphanumeric': 0.08723404255319149, 'fraction_numerical': 0.005957446808510639, 'mean_word_length': 3.29014598540146, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2908914', 'n_tokens_mistral': 706, 'n_tokens_neox': 659, 'n_words': 227}