<commit_before>var test = require('ava');
var optionChain = require('option-chain');
var fnName = require('fn-name');

var chainableMethods = {
  chainableMethods: {
    test: {},
    serial: {serial: true},
    before: {before: true},
    after: {after: true},
    skip: {skip: true},
    todo: {todo: true},
    only: {only: true},
    beforeEach: {beforeEach: true},
    afterEach: {afterEach: true},
    cb: {cb: true},
    // Extras
    describe: {$group: 'describe'},
    feature: {$group: 'feature'},
    group: {$group: 'group'}
  }
};

function nextTarget(target, opts) {
  Object.keys(opts).forEach(function (opt) {
    if (opt[0] !== '$') {
      target = target[opt];
    }
  });

  return target;
}

function getTitle(args) {
  if (args.length === 0) {<commit_msg>Refactor nextTarget method<commit_after>var test = require('ava');
var optionChain = require('option-chain');
var fnName = require('fn-name');

var chainableMethods = {
  chainableMethods: {
    test: {},
    serial: {serial: true},
    before: {before: true},
    after: {after: true},
    skip: {skip: true},
    todo: {todo: true},
    only: {only: true},
    beforeEach: {beforeEach: true},
    afterEach: {afterEach: true},
    cb: {cb: true},
    // Extras
    describe: {$group: 'describe'},
    feature: {$group: 'feature'},
    group: {$group: 'group'}
  }
};

function nextTarget(target, methods) {
  Object.keys(methods).forEach(function (method) {
    if (target.hasOwnProperty(method)) {
      target = target[method];
    }
  });

  return target;
}

function getTitle(args) {
  if (args.length === 0) {
{'fraction_non_alphanumeric': 0.18130489335006272, 'fraction_numerical': 0.0018820577164366374, 'mean_word_length': 3.4060773480662982, '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': '1717839', 'n_tokens_mistral': 535, 'n_tokens_neox': 531, 'n_words': 134}