<commit_before>// Copyright Tampere University of Technology
//-----------------------------------------------------------------------------
// File: SampleSourceAnalyzer.h
//-----------------------------------------------------------------------------
// Project: Kactus2
// Author: <NAME>
// Date: 12.05.2016
//
// Description:
// Sample source analyzer plugin.
//-----------------------------------------------------------------------------

#ifndef SAMPLESOURCEANALYZER_H
#define SAMPLESOURCEANALYZER_H

#include <Plugins/PluginSystem/ISourceAnalyzerPlugin.h>

#include <QFile>
#include <QString>

class SampleSourceAnalyzer : public QObject, public ISourceAnalyzerPlugin
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "kactus2.plugins.sampleSourceAnalyzer" FILE "samplesourceanalyzer.json")

    Q_INTERFACES(IPlugin)
    Q_INTERFACES(ISourceAnalyzerPlugin)

public:
    SampleSourceAnalyzer();
    ~SampleSourceAnalyzer();

    /*!
     *  Returns the name of the plugin.
     */
    virtual QString getName() const;

    /*!
     *  Returns the version of the plugin.
     */
    virtual QString getVersion() const;

    /*!
     *  Returns the description of the plugin.
     */
    virtual QString getDescription() const;

    /*!
     *  Returns the vendor of the plugin.
     */
    virtual QString getVendor() const;

    /*!
     *  Returns the licence of the plugin.
     */
    virtual QString getLicence() const;

    /*!
     *  Returns the holder of the licence of the plugin.
     */
    virtual QString getLicenceHolder() const;

    /*!
     *  Returns the settings widget.
     */
    virtual PluginSettingsWidget* getSettingsWidget();

    /*!
     *  Returns the list of file types this plugin can run analysis for.
     */
    virtual QStringList getSupportedFileTypes() const;

    /*!
     *  Calculates a language-dependent hash for the given file.
     *
     *      @param [in] filename  The name of the file.
     *
     *      @return The hash value for the file.
     *
     *      @remarks Comments and whitespace are ignored and do not affect the hash value.
     */
    virtual QString calculateHash(QString const& filename);

    /*!
     *  This function is called once when the dependency analysis scan is started.<commit_msg>Changed a comment.<commit_after>// Copyright Tampere University of Technology
//-----------------------------------------------------------------------------
// File: SampleSourceAnalyzer.h
//-----------------------------------------------------------------------------
// Project: Kactus2
// Author: <NAME>
// Date: 12.05.2016
//
// Description:
// Sample source analyzer plugin.
//-----------------------------------------------------------------------------

#ifndef SAMPLESOURCEANALYZER_H
#define SAMPLESOURCEANALYZER_H

#include <Plugins/PluginSystem/ISourceAnalyzerPlugin.h>

#include <QFile>
#include <QString>

class SampleSourceAnalyzer : public QObject, public ISourceAnalyzerPlugin
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "kactus2.plugins.sampleSourceAnalyzer" FILE "samplesourceanalyzer.json")

    Q_INTERFACES(IPlugin)
    Q_INTERFACES(ISourceAnalyzerPlugin)

public:
    SampleSourceAnalyzer();
    ~SampleSourceAnalyzer();

    /*!
     *  Returns the name of the plugin.
     */
    virtual QString getName() const;

    /*!
     *  Returns the version of the plugin.
     */
    virtual QString getVersion() const;

    /*!
     *  Returns the description of the plugin.
     */
    virtual QString getDescription() const;

    /*!
     *  Returns the vendor of the plugin.
     */
    virtual QString getVendor() const;

    /*!
     *  Returns the licence of the plugin.
     */
    virtual QString getLicence() const;

    /*!
     *  Returns the holder of the licence of the plugin.
     */
    virtual QString getLicenceHolder() const;

    /*!
     *  Returns the settings widget.
     */
    virtual PluginSettingsWidget* getSettingsWidget();

    /*!
     *  Returns the list of file types this plugin can run analysis for.
     */
    virtual QStringList getSupportedFileTypes() const;

    /*!
     *  Calculates a language-dependent hash for the given file.
     *
     *      @param [in] filename  The name of the file.
     *
     *      @return The hash value for the file.
     */
    virtual QString calculateHash(QString const& filename);

    /*!
     *  This function is called once when the dependency analysis scan is started.
{'fraction_non_alphanumeric': 0.18779661016949153, 'fraction_numerical': 0.004519774011299435, 'mean_word_length': 1.8389993585631814, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2128944', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1137, 'n_words': 356}