<commit_before>'use strict';

var DocumentedNode = require('./DocumentedNode');
var MemberContainerMixin = require('./MemberContainerMixin');

var MEMBER_CATEGORIES = {
  'ctor': {name: 'ctor', path: ['class', 'ctor']},
  'instance-methods': {name: 'instance-methods', path: ['instance', 'method']},
  'instance-properties': {name: 'instance-properties', path: ['instance', 'property']},
  'instance-events': {name: 'instance-events', path: ['instance', 'event']},
  'class-methods': {name: 'class-methods', path: ['class', 'method']},
  'class-properties': {name: 'class-properties', path: ['class', 'property']},
  'inner-classes': {name: 'inner-classes', path: ['class', 'class']}
};

function ClassNode() {
  ClassNode.super.apply(this, arguments);
}

ClassNode.Prototype = function() {
  this.getSpecificType = function() {
    if (this.isAbstract) return 'abstract-class';
    return 'class';
  };

  this.getTocLevel = function() {
    return 2;
  };

  this.getMemberCategories = function() {
    return MEMBER_CATEGORIES;
  };

  var INHERITED = ['instance-methods', 'instance-properties', 'class-methods', 'class-properties'];

  this.getInheritedMembers = function(config) {
    var inheritedMembers = {};
    var doc = this.getDocument();
    var superClass = this.superClass ? doc.get(this.superClass) : null;
    if (superClass) {
      inheritedMembers = superClass.getInheritedMembers(config);
      INHERITED.forEach(function(group) {
        var members = superClass.getCategoryMembers(MEMBER_CATEGORIES[group], config);
        if (members.length > 0) {
          inheritedMembers[group] = inheritedMembers[group] || {};
          members.forEach(function(member) {
            inheritedMembers[group][member.id] = member;
          });
        }
      });
    }
    return inheritedMembers;
  };

};

DocumentedNode.extend(ClassNode, MemberContainerMixin);

ClassNode.static.name = 'class';
ClassNode.static.defineSchema({
  parent: 'id',
  name: 'string',
  members: { type: ['array', 'id'], default: [] },
  isAbstract: { type: 'boolean', default: false },
  isStatic: { type: 'boolean', default: false },
  superClass: { type: 'id', optional: true }, // only when @extends is defined
});

ClassNode.static.isBlock = true;

module.exports = ClassNode;

<commit_msg>Don't show inherited static members.<commit_after>'use strict';

var DocumentedNode = require('./DocumentedNode');
var MemberContainerMixin = require('./MemberContainerMixin');

var MEMBER_CATEGORIES = {
  'ctor': {name: 'ctor', path: ['class', 'ctor']},
  'instance-methods': {name: 'instance-methods', path: ['instance', 'method']},
  'instance-properties': {name: 'instance-properties', path: ['instance', 'property']},
  'instance-events': {name: 'instance-events', path: ['instance', 'event']},
  'class-methods': {name: 'class-methods', path: ['class', 'method']},
  'class-properties': {name: 'class-properties', path: ['class', 'property']},
  'inner-classes': {name: 'inner-classes', path: ['class', 'class']}
};

function ClassNode() {
  ClassNode.super.apply(this, arguments);
}

ClassNode.Prototype = function() {
  this.getSpecificType = function() {
    if (this.isAbstract) return 'abstract-class';
    return 'class';
  };

  this.getTocLevel = function() {
    return 2;
  };

  this.getMemberCategories = function() {
    return MEMBER_CATEGORIES;
  };

  // var INHERITED = ['instance-methods', 'instance-properties', 'class-methods', 'class-properties'];
  var INHERITED = ['instance-methods', 'instance-properties'];

  this.getInheritedMembers = function(config) {
    var inheritedMembers = {};
    var doc = this.getDocument();
    var superClass = this.superClass ? doc.get(this.superClass) : null;
    if (superClass) {
      inheritedMembers = superClass.getInheritedMembers(config);
      INHERITED.forEach(function(group) {
        var members = superClass.getCategoryMembers(MEMBER_CATEGORIES[group], config);
        if (members.length > 0) {
          inheritedMembers[group] = inheritedMembers[group] || {};
          members.forEach(function(member) {
            inheritedMembers[group][member.id] = member;
          });
        }
      });
    }
    return inheritedMembers;
  };

};

DocumentedNode.extend(ClassNode, MemberContainerMixin);

ClassNode.static.name = 'class';
ClassNode.static.defineSchema({
  parent: 'id',
  name: 'string',
  members: { type: ['array', 'id'], default: [] },
  isAbstract: { type: 'boolean', default: false },
  isStatic: { type: 'boolean', default: false },
  superClass: { type: 'id', optional: true }, // only when @extends is defined
});

ClassNode.static.isBlock = true;

module.exports = ClassNode;


{'fraction_non_alphanumeric': 0.17177782543426978, 'fraction_numerical': 0.0008578168561012224, 'mean_word_length': 4.193763919821826, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2448694', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1420, 'n_words': 306}