4 views
melgarafael/DeskcommCRM
Open-source AI sales OS — self-hosted CRM with native AI agents + WhatsApp (WAHA). Open alternative to Kommo, Octadesk & Intercom for any business that sells by chat. MCP-ready, multi-tenant, LGPD.
TypeScript★ 2,941+193 that day#4 on trending
5.2%duplicated code · 15,363 of 295,672 lines
1,158clones in code
1,829code files of 4,213 scanned
8.32%duplicated over all files · 3,617 clones
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.
Largest clones in the code
- 165 lines in 2 placesbash868 tokens.agents/skills/deskcomm-contribuir/scripts/pre-voo.sh:1–165.claude/skills/deskcomm-contribuir/scripts/pre-voo.sh:1–165
1#!/usr/bin/env bash 2# pre-voo.sh — mede, ANTES do PR, o que a triagem do mantenedor mede DEPOIS. 3# 4# Só lê. Nunca edita, nunca bloqueia: imprime uma linha por item, com a medida 5# e o comando que a produziu, para a pessoa (ou o assistente) decidir. Sai com 6# 0 mesmo cheio de ✗ — o veredito é de quem lê, e um script que "reprova" o 7# próprio autor vira script que ninguém roda. 8# 9# ✓ medido e limpo ⚠ olhe isto ✗ vai travar na triagem · não se aplica 10#First 10 of 165 lines.
- 12 lines in 11 placestypescript66 tokensapp/api/v1/attendants/availability/[user_id]/route.ts:62–73app/api/v1/contacts/merge/route.ts:91–102app/api/v1/conversations/[id]/claim/route.ts:52–65app/api/v1/conversations/[id]/usable-for-rag/route.ts:46–57app/api/v1/leads/[id]/move/route.ts:45–57and 6 more
62 input = await validateRequest(availabilityPatchSchema, req); 63} catch (err) { 64 if (err instanceof ApiError) { 65 return fail(err.code, err.message, err.status, { 66 details: err.details as Record<string, unknown> | undefined, 67 requestId, 68 }); 69 } 70 throw err; 71}First 10 of 12 lines.
- 37 lines in 13 placestypescript54 tokensapp/api/v1/ai/budget/route.ts:1–37app/api/v1/ai/inbox/[id]/route.ts:1–14app/api/v1/ai/memory/entries/[id]/route.ts:1–14app/api/v1/ai/memory/entries/route.ts:1–14app/api/v1/ai/memory/route.ts:1–18and 8 more
1import { requireSupportWrite } from "@/lib/impersonate/support"; 2/** 3 * GET /api/v1/ai/budget — o estado do orçamento da org ativa (manager+). 4 * PATCH /api/v1/ai/budget — muda teto, limiar e MODO (admin). 5 * 6 * `organization_id` vem do JWT via `requireRole` — nunca do body. O PATCH usa 7 * service role e filtra por `orgId` explicitamente (doutrina). 8 * 9 * ═══ A ESCADA, E POR QUE ELA É VALIDADA NO SERVIDOR ═══ 10 *1import { requireSupportWrite } from "@/lib/impersonate/support"; 2/** 3 * Épico Operação Visível (F1) — transição de status de um aviso do agente. 4 * PATCH { status: 'ack' | 'resolved' | 'open' } — org-scoped, auditado. 5 * Reabrir (→'open') é permitido: resolver por engano não pode esconder alerta. 6 */ 7import { randomUUID } from "node:crypto"; 8import { type NextRequest } from "next/server"; 9import { z } from "zod"; 10First 10 of 37 lines, the second copy on the right.
7 more
- 13 lines in 8 placestypescript76 tokens
- 10 lines in 10 placestypescript58 tokens
- 18 lines in 2 placesbash416 tokens
- 43 lines in 2 placestypescript394 tokens
- 16 lines in 5 placestypescript95 tokens
- 73 lines in 2 placesbash343 tokens
- 24 lines in 3 placestypescript168 tokens
Largest clones over all files, tests and data included
- 7059 lines in 2 placesmarkupdocs and examples69,896 tokens
4512 Workflow diagram • Built with Archify<span class="no-print"> • Hover to trace • <kbd>R</kbd> route • Click to focus • <kbd>+</kbd>… 4513 </p> 4514</div> 4515 4516<script> 4517 /* ============================================================ 4518 Theme toggle — persists to localStorage, respects system pref 4519 ============================================================ */ 4520 var Archify = {}; 4521First 10 of 7059 lines.
- 3763 lines in 2 placesmarkupdocs and examples44,583 tokens
7<title>Turno do Agente de IA Diagram</title> 8<script> 9 // Resolve the theme before first paint so light-preference users don't 10 // see a dark flash. The toolbar script below re-applies with UI state. 11 (function () { 12 try { 13 var theme = null; 14 try { 15 var param = new URLSearchParams(window.location.search).get('theme'); 16 if (param === 'light' || param === 'dark') theme = param;First 10 of 3763 lines.
- 279 lines in 2 placessqldocs and examples3,267 tokens.agents/skills/deskcomm-metricas/references/consultas.md:13–291.claude/skills/deskcomm-metricas/references/consultas.md:13–291
13select extract(isodow from (m.sent_at at time zone o.timezone))::int as dow, 14 extract(hour from (m.sent_at at time zone o.timezone))::int as hora, 15 count(*) as recebidas, count(distinct m.conversation_id) as conversas 16 from public.messages m 17 join public.conversations c on c.id = m.conversation_id and c.organization_id = m.organization_id 18 join public.organizations o on o.id = m.organization_id 19 where m.organization_id = :org and m.direction = 'inbound' and c.is_group = false 20 and m.sent_at >= :de and m.sent_at < :ate 21 group by 1,2 order by 1,2; 22```First 10 of 279 lines.
- 166 lines in 2 placesmarkupdocs and examples2,548 tokens
- 155 lines in 2 placesmarkdowndocs and examples2,367 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| typescript | 1,249 | 205,748 | 943 | 12,292 | 5.97% |
| tsx | 515 | 77,747 | 200 | 2,570 | 3.31% |
| bash | 53 | 11,263 | 14 | 477 | 4.24% |
| sql | 3 | 166 | 1 | 24 | 14.46% |
| javascript | 7 | 540 | 0 | 0 | 0% |
| perl | 1 | 174 | 0 | 0 | 0% |
| powershell | 1 | 34 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| typescript | 2,510 | 461,813 | 2,737 | 36,663 | 7.94% |
| tsx | 649 | 97,133 | 330 | 4,405 | 4.54% |
| sql | 256 | 32,338 | 284 | 6,379 | 19.73% |
| markdown | 355 | 137,299 | 77 | 3,398 | 2.47% |
| json | 81 | 13,887 | 60 | 2,969 | 21.38% |
| markup | 6 | 23,077 | 49 | 11,443 | 49.59% |
| bash | 122 | 14,128 | 29 | 586 | 4.15% |
| txt | 24 | 2,350 | 23 | 239 | 10.17% |
| text | 83 | 2,898 | 15 | 59 | 2.04% |
| css | 9 | 1,671 | 9 | 107 | 6.4% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Sep 16, 2026 | #4 | 2,941 (+193) | 4,213 | 796,417 | 3,617 | 8.32% | 5.2% | — | cf35c94 |
| Sep 14, 2026 | #4 | 2,316 (+432) | 3,976 | 746,616 | 3,406 | 8.4% | 5.31% | — | 5342814 |
| Sep 13, 2026 | #2 | 1,887 (+504) | 3,976 | 746,616 | 3,406 | 8.4% | 5.31% | — | 5342814 |
| Sep 12, 2026 | #4 | 1,439 (+152) | 3,982 | 746,644 | 3,406 | 8.4% | 5.31% | — | e142504 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.