<commit_before>/**
 * Created with JetBrains RubyMine.
 * User: teamco
 * Date: 11/5/12
 * Time: 9:51 PM
 * To change this template use File | Settings | File Templates.
 */

define([
    'config/setting',
    'modules/base',
    'modules/crud'
], function initModel(Setting, Base, CRUD) {

    /**
     * Define Base model
     * @class BaseModel
     * @constructor
     */
    var BaseModel = function BaseModel() {

    };

    return BaseModel.extend({

        /**
         * Define global setting
         */
        defineSetting: function defineSetting() {
            this.setting = new Setting(this.scope.controller.getMode());
        },

        /**
         * Get scope config
         * @param {String} [key]
         * @returns {*}
         */
        getConfig: function getConfig(key) {
            var scope = this.scope,
                config = scope.config;
            if (config.hasOwnProperty(key)) {
                scope.logger.debug('Get config by key', key);
                return config[key];
            }

            if (this.scope.controller.checkCondition({
                condition: this.base.isDefined(key),
                type: 'warn',
                msg: 'Undefined config key',
                args: [key]
            })) {
                return false;
            }

            return config;<commit_msg>fix get config method<commit_after>/**
 * Created with JetBrains RubyMine.
 * User: teamco
 * Date: 11/5/12
 * Time: 9:51 PM
 * To change this template use File | Settings | File Templates.
 */

define([
    'config/setting',
    'modules/base',
    'modules/crud'
], function initModel(Setting, Base, CRUD) {

    /**
     * Define Base model
     * @class BaseModel
     * @constructor
     */
    var BaseModel = function BaseModel() {

    };

    return BaseModel.extend({

        /**
         * Define global setting
         */
        defineSetting: function defineSetting() {
            this.setting = new Setting(this.scope.controller.getMode());
        },

        /**
         * Get scope config
         * @param {String} [key]
         * @returns {*}
         */
        getConfig: function getConfig(key) {
            var scope = this.scope,
                config = scope.config;
            if (config.hasOwnProperty(key)) {
                scope.logger.debug('Get config by key', key);
                return config[key];
            }
            if (this.scope.controller.checkCondition({
                condition: this.base.isDefined(key),
                type: 'warn',
                msg: 'Undefined config key',
                args: [key]
            })) {
                return false;
            }

            return config;
{'fraction_non_alphanumeric': 0.11738648947951273, 'fraction_numerical': 0.005906238464377999, 'mean_word_length': 1.5162488393686164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4419927', 'n_tokens_mistral': 751, 'n_tokens_neox': 714, 'n_words': 182}