Skip to content
AI

What Do AI Detectors Look for in Code? 7 Signals

A code detector measures comment density, naming consistency, docstring templates and line-length spread, not authorship. The 7 signals, and where they fail.

By ZeroTell Editorial Team5 min read

What Do AI Detectors Look for in Code? 7 Signals
On this page
  1. What do AI detectors look for in code?
  2. How it works: 4 steps
  3. Which signals point to AI, and which point to a person
  4. Why a band instead of a percentage
  5. Which languages are supported
  6. Why code is easier to misjudge than prose
  7. How to use the report once you have it
  8. One line that must not be crossed
  9. Where this comes from

TL;DR: A code detector measures style habits — comment density, comment phrasing, naming consistency, scaffolding, docstring templates, error-handling verbosity and line-length spread — not authorship. ZeroTell's AI Code Detector returns a low, medium or high band and deliberately refuses to give a percentage, because a percentage would claim precision that style analysis cannot deliver.

A code detector reads the countable style features of a file, not the fingerprint of the person who typed it. When a file comes back as "looks like AI", that means its comment density, naming pattern and structural repetition landed inside the range machine output usually occupies. It does not say who was at the keyboard. The logic is the same one text detectors use, but code has strict syntax, conventional names and heavily repeated structure — so there is more room for a false positive.

To understand how text detection works first, see how detectors work; for how results shift by content type, see detection by content type. To check your own code, use the AI Code Detector; to look for copied code, use the code plagiarism checker.

What do AI detectors look for in code?

They do not judge whether the logic is correct, or whether the problem was hard. They count 7 kinds of measurable style habit:

SignalWhat is actually counted
Comment densityHow many lines out of every 100 are comments
Comment phrasingWhether comments narrate what the code does, or explain why it does it
Naming consistencyWhether variables and functions follow one naming style throughout
ScaffoldingWhether the file carries example-usage blocks, if __name__ == "__main__", and similar boilerplate
Docstring templatesWhether docstrings reuse one fixed sentence pattern
Error-handling verbosityWhether try/except covers more than it needs to, and whether logging is filled out to the maximum
Line-length spreadWhether every line is close to the same length

All 7 describe how the code was written, not who wrote it.

How it works: 4 steps

  1. Paste or upload: a single function, one file, or a whole assignment.
  2. Measure style: the 7 habit families above are counted with the same method every time.
  3. A model reviews the code: it reads the numbered code alongside those measurements and writes short notes on the lines that stand out, for and against AI generation.
  4. Return a band and the reasons: low, medium or high likelihood, with the evidence listed so a person can judge.

One check costs 2 credits.

Which signals point to AI, and which point to a person

The important part: the same signal set counts in both directions.

SignalReads as AIReads as human-written
CommentsEvery block opens with "this function is used to…"Comments are sparse, added only where the logic bends
TODONo TODOs, or ones with no contextTODOs carrying a name, a date, a known issue
NamingNaming style is perfectly uniform across the fileLocal inconsistencies in naming habit
DocstringsEvery function uses the same template sentenceSome functions have them, some do not
Error handlingLayered try/except with full loggingHandled only where failure is realistic
Line lengthLengths cluster in a narrow rangeWide spread, with occasional very long lines
StructureObvious example blocks and scaffoldingA structure written for this specific problem

"Tidy" does not mean "machine", and "untidy" does not mean "human" — but tidiness is genuinely one of the signals.

Why a band instead of a percentage

The product page puts the reason plainly: a percentage would suggest a precision that style analysis cannot deliver.

The difference is easy to see:

OutputHow a reader takes itIs it true
"87% AI-written"I can be 87% sure who wrote thisNo
"High likelihood"The signals point clearly toward AI styleYes
"Medium"Signals are mixed; read the specific linesYes

A band forces you to look at the evidence. A percentage lets you skip the evidence and reach a conclusion — which is exactly the risk.

Which languages are supported

ZeroTell's AI Code Detector recognises 14 languages automatically:

Python, JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, PHP, Ruby, Kotlin, Swift and SQL — all detected automatically.

You can also set the language yourself. Code detection is language-sensitive: the same habit that is normal in Python may be abnormal in Java, where getters, setters and import blocks are repetitive by design.

Why code is easier to misjudge than prose

Three structural reasons.

First, naming is already conventional. Loop counters are called i and j; temporary results are called tmp. That is industry habit. AI writes the same way, so "the names are common" fires almost constantly in code.

Second, structural repetition is necessary. The five methods of a CRUD endpoint look nearly identical. In prose, repetition is a flaw. In code, repetition is readability.

Third, comment style is constrained by team rules. Plenty of companies require a docstring on every public method, in a fixed format. A developer who follows those rules writes code that looks more templated than machine output.

Which is why the product page states it directly: senior developers who comment carefully and follow a style guide often produce code that looks "AI-like".

How to use the report once you have it

The product page lists 4 kinds of user, each with a different use:

UserHow to use the report
Computer science teachersA starting point for a conversation with a student, with specific lines to ask about
StudentsA self-check before submitting, to see which habits make the code look generated
Hiring teamsReview a take-home task, then discuss specific lines in the follow-up interview
Open-source maintainersDecide which contributions need a closer look at licensing and test coverage

What all four share: the report decides what to ask about, not what to conclude.

One line that must not be crossed

The product page contains a sentence worth reading word by word:

Clean, well-commented code written by a careful person can look "AI-like", and edited AI code can look human. Never accuse anyone on the strength of this report alone.

That is the same principle as ZeroTell's academic integrity policy: tool results cannot replace policy, evidence, and conversation between people.

Where this comes from

The product specifications in this article — the 7 style signals, the 4-step process, the 3-band output, the 14 languages and the 2-credit cost — come from ZeroTell's AI Code Detector product page. How AI use and reuse are drawn in programming assignments draws on Starter Code, Stack Overflow, and a Programming Assignment on Telegraph; the point that formulaic style reads as AI draws on Why Formulaic Writing Often Looks Like AI. Both are materials published by ZeroTell itself, not independent reporting. This article cites only the specifications published on the product page and does not cite unverified accuracy figures.

Frequently asked questions

Can a code detector prove the code was written by AI?

No. It measures 7 style habits such as comment density and naming consistency. A signal is not evidence, and developers who comment carefully and follow a style guide often produce code that reads as AI-like.

Why does it return a band instead of a percentage?

A percentage would suggest a precision that style analysis cannot deliver. The product page states plainly that code style is not a fingerprint, so low, medium and high are the honest outputs.

Which languages are supported?

14 are detected automatically: Python, JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, PHP, Ruby, Kotlin, Swift and SQL. You can also set the language yourself.

Why is code more easily misjudged than prose?

Three reasons: naming is already conventional (i, j, tmp), structural repetition is necessary (CRUD methods look alike), and comment style is bound by team rules. All three make human code look templated.

What should I do with the report?

Treat it as a starting point for what to ask, not a conclusion. Teachers pick specific lines to discuss, students self-check habits, hiring teams discuss lines in the interview, maintainers decide what to review.

Try it on your own text

AI Detector

Sentence-level AI score

Open AI Detector

Related articles

AI

Should Teachers Use AI Detectors to Grade?

A detector can be a clue, never a rubric row: human work is flagged 1.5%, unedited AI text 97%, paraphrased AI only 89.2%. A number that moves cannot grade.

5 min read