fmtlib/fmt

A modern formatting library

C++★ 25,581+134 that day#1 on trending

Analyzed September 6, 2026 at 0f3c5fd (main) with jscpd 5.4.0 in 0.8s. Code duplication stayed at 1.24% across 4 appearances since Sep 3.

1.24%duplicated code · 251 of 20,306 lines
29clones in code
36code files of 122 scanned
1.24%duplicated over all files · 97 clones

The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.

Largest clones in the code

  • 13 lines in 3 placesc-header93 tokens
    1933struct formatter<day, Char> : private formatter<std::tm, Char> {
    1934 private:
    1935  bool use_tm_formatter_ = false;
    1936
    1937 public:
    1938  FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
    1939    auto it = ctx.begin(), end = ctx.end();
    1940    use_tm_formatter_ = it != end && *it != '}';
    1941    return use_tm_formatter_ ? formatter<std::tm, Char>::parse(ctx) : it;
    1942  }
    

    First 10 of 13 lines.

  • 9 lines in 2 placesc-header174 tokens
    505 * escape sequences to specify text formatting.
    506 *
    507 * **Example**:
    508 *
    509 *     fmt::print(fmt::emphasis::bold | fg(fmt::color::red),
    510 *                "Elapsed time: {0:.2f} seconds", 1.23);
    511 */
    512template <typename... T>
    513void print(FILE* f, text_style ts, format_string<T...> fmt, T&&... args) {
    
    519 * specify text formatting.
    520 *
    521 * **Example**:
    522 *
    523 *     fmt::print(fmt::emphasis::bold | fg(fmt::color::red),
    524 *                "Elapsed time: {0:.2f} seconds", 1.23);
    525 */
    526template <typename... T>
    527void print(text_style ts, format_string<T...> fmt, T&&... args) {
    
  • 7 lines in 4 placesc-header58 tokens
    1905struct formatter<weekday, Char> : private formatter<std::tm, Char> {
    1906 private:
    1907  bool use_tm_formatter_ = false;
    1908
    1909 public:
    1910  FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
    1911    auto it = ctx.begin(), end = ctx.end();
    
7 more
Largest clones over all files, tests and data included
By format, code only
FormatFilesLinesClonesDuplicated linesDuplication
c-header1517,081282441.43%
cpp4676171.04%
python61,601000%
bash9644000%
perl1174000%
groovy1130000%
By format, all files
FormatFilesLinesClonesDuplicated linesDuplication
c-header2542,619565891.38%
cpp4327,322354111.5%
markdown119,1355390.43%
yaml10769181.04%
txt101,898000%
python61,601000%
bash11743000%
perl1174000%
groovy1130000%
c1112000%

Trending appearances

DayRankStarsFilesLinesClonesAll filesCodeHealthCommit
Sep 6, 2026#125,581 (+134)12284,596971.24%1.24%—0f3c5fd
Sep 5, 2026#125,496 (+688)12284,598961.23%1.24%—6226bc7
Sep 4, 2026#125,204 (+963)12284,653961.23%1.24%—bc82c40
Sep 3, 2026#124,448 (+14)12284,653961.23%1.24%—bc82c40

Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.