Beispiel #1
0
def start():
    setup_logging()
    logger = logging.getLogger("main")
    logger.info("Starting linkSHARK...")

    parser = get_base_argparser(
        'Analyze the given URI. An URI should be a GIT Repository address.',
        '1.0.0')
    parser.add_argument('-n',
                        '--project-name',
                        help='Name of the project.',
                        required=True)
    parser.add_argument(
        '--broken-keys',
        help=
        'Comma seperated list of broken keys of issue references (currently only works for Jira)',
        required=False,
        default='')
    parser.add_argument('--correct-key',
                        help='The correct key for issue references',
                        required=False,
                        default='')
    parser.add_argument('--log-level',
                        help='Log Level for stdout INFO or DEBUG.',
                        required=False,
                        default='INFO')

    args = parser.parse_args()
    cfg = Config(args)

    logger.debug("Got the following config: %s" % cfg)
    link_shark = LinkSHARK()
    link_shark.start(cfg)
Beispiel #2
0
def start():
    """
    Starts the application. First parses the different command line arguments and then it gives these to
    :class:`~memeshark.memeshark.MemeSHARK`
    """
    setup_logging()
    logger = logging.getLogger("main")
    logger.info("Starting memeSHARK...")

    parser = get_base_argparser(
        'Plugin to remove code entities and code groups that did not change in a revision.',
        '0.1.0')
    parser.add_argument(
        '--log-level',
        help='Sets the debug level.',
        default='DEBUG',
        choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'])
    parser.add_argument('-n',
                        '--project-name',
                        help='Name of the project to compress.',
                        required=True)
    parser.add_argument('-c',
                        '--processes',
                        help='Number of parallel processes.',
                        default=1)

    args = parser.parse_args()
    cfg = Config(args)

    logger.debug("Got the following config: %s" % cfg)
    meme_shark = MemeSHARK()
    meme_shark.start(cfg)
Beispiel #3
0
def start():
    """
    Starts the application. First parses the different command line arguments and then it gives these to the mecoApp
    :return:
    """
    setup_logging()
    logger = logging.getLogger("mecoshark_main")
    logger.info("Starting mecoSHARK...")

    parser = get_base_argparser(
        'Calculates metrics & performs clone detection for the given version.',
        '1.0.0')
    parser.add_argument('-i',
                        '--input',
                        help='Path to the repository.',
                        required=True,
                        type=readable_dir)
    parser.add_argument('-o',
                        '--output',
                        help='Directory, which can be used as output.',
                        required=True,
                        type=writable_dir)
    parser.add_argument('-pn', '--project_name', help='Name of the Project.')
    parser.add_argument('-r',
                        '--revision',
                        help='Hash of the revision.',
                        required=True)
    parser.add_argument('-u',
                        '--repository_url',
                        help='URL of the project (e.g., GIT Url).',
                        required=True)
    parser.add_argument('--debug',
                        help='Specifies the debug level',
                        choices=['INFO', 'DEBUG', 'WARNING', 'ERROR'],
                        default='DEBUG')
    parser.add_argument('--makefile-contents',
                        help='Makefile contents',
                        default=None)

    try:
        args = parser.parse_args()
    except Exception as e:
        logger.error(e)
        sys.exit(1)

    logger.debug(
        "Got the following parameters. Input: %s, Output: %s, Project name: %s, Revision: %s, URL: %s, Makefile-contents: %s"
        % (args.input, args.output, args.project_name, args.revision,
           args.repository_url, args.makefile_contents))

    mecoshark = MecoSHARK(args.input, args.output, args.project_name,
                          args.revision, args.repository_url,
                          args.makefile_contents, args.db_database,
                          args.db_hostname, args.db_port, args.db_user,
                          args.db_password, args.db_authentication, args.debug,
                          args.ssl)
    mecoshark.process_revision()
Beispiel #4
0
def start():
    """ Start method to start the program. It first sets up the logging and then parses all the arguments
    it got from the commandline.
    """

    setup_logging()
    logger = logging.getLogger("main")

    try:
        datastore_choices = get_datastore_choices()
    except Exception as e:
        logger.exception("Failed to instantiate datastore")
        sys.exit(1)

    if not datastore_choices:
        logger.error("No datastores found! Exiting...")
        sys.exit(1)

    parser = get_base_argparser(
        'Analyze the given URI. An URI can be a checked out directory. If URI is omitted, '
        'the current working directory will be used as a checked out directory.',
        '1.0.0')
    parser.add_argument(
        '-D',
        '--db-driver',
        help='Output database driver. Currently only mongoDB is supported',
        default='mongo',
        choices=datastore_choices)
    parser.add_argument('-d',
                        '--debug',
                        help='Debug level',
                        choices=['INFO', 'DEBUG', 'WARNING', 'ERROR'],
                        default='INFO')
    parser.add_argument('-n',
                        '--project-name',
                        help='Name of the project, that is analyzed',
                        required=True)
    parser.add_argument('--path',
                        help='Path to the checked out repository directory',
                        default=os.getcwd(),
                        type=readable_dir)

    logger.info("Reading out config from command line")

    try:
        args = parser.parse_args()
    except Exception as e:
        logger.error(e)
        sys.exit(1)

    read_config = Config(args)
    logger.debug('Read the following config: %s' % read_config)

    Application(read_config)
Beispiel #5
0
def start():
    start = timeit.default_timer()
    setup_logging()
    logger = logging.getLogger("main")
    logger.info("Starting pymweSHARK...")

    parser = get_base_argparser('', '0.0.1')
    parser.add_argument('--output', help='Output Folder', required='true')

    parser.add_argument('--debug', help='Sets the debug level.', default='DEBUG',
                        choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'])
						
	print("Hello World")
Beispiel #6
0
def start():
    """
    Starts the application. First parses the different command line arguments and then it gives these to
    :class:`mailingshark.mailingshark.MailingSHARK`.
    """
    setup_logging()
    logger = logging.getLogger("main")
    logger.info("Starting mailingSHARK...")

    try:
        backend_choices = BaseDataCollector.get_all_possible_backend_options()
    except Exception as e:
        logger.exception("Failed to instantiate backend.")
        sys.exit(1)

    parser = get_base_argparser('Collects information from mailing lists.',
                                '1.0.0')
    parser.add_argument('-o',
                        '--output',
                        help='Directory, which can be used as output.',
                        required=True,
                        type=writable_dir)
    parser.add_argument('-n',
                        '--project-name',
                        help='Name of the project.',
                        required=True)
    parser.add_argument('-m',
                        '--mailing-url',
                        help='URL to the bugtracking system.',
                        required=True)
    parser.add_argument('-b',
                        '--backend',
                        help='Backend to use for the mailing parsing',
                        choices=backend_choices)
    parser.add_argument('-PH',
                        '--proxy-host',
                        help='Proxy hostname or IP address.',
                        default=None)
    parser.add_argument('-PP',
                        '--proxy-port',
                        help='Port of the proxy to use.',
                        default=None)
    parser.add_argument('-Pp',
                        '--proxy-password',
                        help='Password to use the proxy (HTTP Basic Auth)',
                        default=None)
    parser.add_argument('-PU',
                        '--proxy-user',
                        help='Username to use the proxy (HTTP Basic Auth)',
                        default=None)
    parser.add_argument(
        '--debug',
        help='Sets the debug level.',
        default='DEBUG',
        choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'])

    try:
        args = parser.parse_args()
        cfg = Config(args)
    except ConfigValidationException as e:
        logger.error(e)
        sys.exit(1)

    mailingshark = MailingSHARK()
    mailingshark.start(cfg)
Beispiel #7
0
    # add specific configs
    labelshark = LabelSHARK()
    commit_count = Commit.objects(vcs_system_id=vcs.id).count()

    for i,commit in enumerate(Commit.objects(vcs_system_id=vcs.id).only('id', 'revision_hash', 'vcs_system_id', 'message', 'linked_issue_ids', 'parents', 'fixed_issue_ids', 'szz_issue_ids').timeout(False)):
        if i%100 == 0:
            log.info("%i/%i  commits finished", i, commit_count)
        labelshark.set_commit(commit)
        labels = labelshark.get_labels()

        #log.info('commit: {}, labels: {}'.format(commit.revision_hash, labels))

        # save the labels
        if labels:
            tmp = {'set__labels__{}'.format(k): v for k, v in labels}
            Commit.objects(id=commit.id).upsert_one(**tmp)

    end = timeit.default_timer() - start
    log.info("Finished commit labeling in {:.5f}s".format(end))


if __name__ == '__main__':
    parser = get_base_argparser('Analyze the given URI. An URI should be a GIT Repository address.', '1.0.0')
    parser.add_argument('-n', '--project-name', help='Name of the project.', required=True)
    parser.add_argument('-ap', '--approaches',
                        help='Comma separated list of python module names that implement approaches or all for every approach.',
                        required=False, default='all')
    parser.add_argument('-ll', '--log_level', help='Log Level for stdout INFO or DEBUG.', required=False,
                        default='INFO')
    main(parser.parse_args())
Beispiel #8
0
            # this is not ciritcal, we can still do the other files
            except IndentationError as e:
                log.info(str(e))
            # this is critical
            except Exception as e:
                log.exception(e)
                raise

    end = timeit.default_timer() - start
    log.info("Finished AST extraction in {:.5f}s".format(end))


if __name__ == '__main__':
    # we basically re-use the vcsSHARK argparse config here
    parser = get_base_argparser(
        'Analyze the given URI. An URI should be a checked out GIT Repository.',
        '2.0.4')
    parser.add_argument('-i',
                        '--input',
                        help='Path to the checked out repository directory',
                        required=True)
    parser.add_argument('-pn',
                        '--project_name',
                        help='Name of the project.',
                        required=False)
    parser.add_argument('-r',
                        '--revision',
                        help='Hash of the revision.',
                        required=True)
    parser.add_argument('-u',
                        '--repository_url',
Beispiel #9
0
def start():
    """
    Starts the application. First parses the different command line arguments and then it gives these to
    :class:`~issueshark.issueshark.IssueSHARK`
    """
    setup_logging()
    logger = logging.getLogger("main")
    logger.info("Starting issueSHARK...")

    try:
        backend_choices = BaseBackend.get_all_possible_backend_options()
    except Exception as e:
        logger.exception("Failed to instantiate backend.")
        sys.exit(1)

    logger.debug("Found the following backends: %s" %
                 ', '.join(backend_choices))

    parser = get_base_argparser(
        'Collects information from different issue tracking systems.', '1.0.0')
    parser.add_argument('-n',
                        '--project-name',
                        help='Name of the project to analyze.',
                        required=True)
    parser.add_argument('-i',
                        '--issueurl',
                        help='URL to the bugtracking system.',
                        required=True)
    parser.add_argument('-b',
                        '--backend',
                        help='Backend to use for the issue parsing',
                        default='github',
                        choices=backend_choices)
    parser.add_argument('-PH',
                        '--proxy-host',
                        help='Proxy hostname or IP address.',
                        default=None)
    parser.add_argument('-PP',
                        '--proxy-port',
                        help='Port of the proxy to use.',
                        default=None)
    parser.add_argument('-Pp',
                        '--proxy-password',
                        help='Password to use the proxy (HTTP Basic Auth)',
                        default=None)
    parser.add_argument('-PU',
                        '--proxy-user',
                        help='Username to use the proxy (HTTP Basic Auth)',
                        default=None)
    parser.add_argument('-iU',
                        '--issue-user',
                        help='Username to use the issue tracking system',
                        default=None)
    parser.add_argument('-iP',
                        '--issue-password',
                        help='Password to use the issue tracking system',
                        default=None)
    parser.add_argument(
        '--debug',
        help='Sets the debug level.',
        default='DEBUG',
        choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'])
    parser.add_argument('-t',
                        '--token',
                        help='Token for accessing.',
                        default=None)

    try:
        args = parser.parse_args()
        cfg = Config(args)
    except ConfigValidationException as e:
        logger.error(e)
        sys.exit(1)

    issueshark = IssueSHARK()
    issueshark.start(cfg)