Skip to content

Repositories & sources ​

Your code reaches Nomain through repositories. Nomain analyzes each repository on its own, and the repositories attached to a particular System are its sources. A System follows its sources: when a repository's analysis finishes, every System built from it is brought up to date.

Repositories vs sources ​

  • A repository is a saved connection to where your code lives: a Git repository or an SFTP location. You connect it once and can use it in any number of Systems.
  • A source is a repository attached to a specific System. The same repository can be a source of several Systems at once.

For how repositories, Systems and tags fit together, see Organizing your estate.

The Repositories page ​

Repositories, under Administration in the left sidebar, lists every repository your organization has connected, one card per repository. Each card shows:

  • The repository's name, its type (Git or SFTP), when it was last analyzed (Not analysed yet before its first analysis), and the commit that was analyzed.
  • Its status, as for a System. A repository that has never been analyzed reads Not analysed.
  • The languages found in it.
  • Lines of code, Files, Code entities, and how many Systems use it.
  • The saved credential it uses, Own credentials when it has its own, or Public when it needs none.

The header shows how many repositories are listed and their lines of code, each repository counted once, however many Systems use it. A repository not analyzed yet is not counted, and the header says how many those are. The totals follow the status filter.

The list is sorted by name to begin with. Sort it by Name, Status or Last analysed, and filter it by status. Nomain remembers your sort and filter for your next visit. Click a card to open the repository's page.

The Repositories page: repository cards with their type, status, languages and figures, and Sort, Filter and New repository in the header.The Repositories page: repository cards with their type, status, languages and figures, and Sort, Filter and New repository in the header.

The Repositories page and each repository's page are for administrators: members do not see them. Browsing, adding, analyzing, editing and deleting repositories are administrator actions.

Adding a repository ​

  1. On the Repositories page, click New repository.
  2. Give it a Name, choose a Type (Git or SFTP), and fill in the connection details.
  3. Optionally, click Set an analysis scope to limit what Nomain stores and analyzes. The editor is labelled Analysis scope (optional). See Analysis scope.
  4. Optionally, under Auto-analysis, turn on Analyse automatically and choose Daily, Weekly or Auto. Weekly is preselected, and Auto is offered while the type is Git. See Automatic re-analysis.
  5. Click Create.

The switch is off by default. If you change the type to SFTP while Auto is selected, the choice goes back to Weekly. If the repository is created but its auto-analysis cannot be turned on, the repository stays and Nomain says Repository connected. Auto-analysis could not be turned on: set it on the repository's Settings tab. Auto-analysis is not part of Edit connection: change it later on the Settings tab.

A new repository is analyzed the first time you click Analyze on its page, when you add it to a System, or, on Auto, at its first check. Adding a repository to a System never changes its auto-analysis.

A repository's page ​

The header shows the repository's name, its status, its type, its Generation, the commit that was analyzed, when, and the repository's auto-analysis (for example Auto-analysis weekly or Auto-analysis on code changes). Each analysis that finds changes gives the repository a new generation number. Below the header, the page has four tabs: Overview, Job history, Insights and Settings. Overview shows:

  • Summary: what the repository does, Written by the assistant from the analysis, with the generation and commit it describes. Still current shows when nothing has changed since. Before the first analysis it reads Nomain writes one with the next analysis.
  • Statistics: Lines of code, Files, Code entities with their connections, Directly parsed, and Unused code (Off with Turned off in Settings while unused code detection is off), then the languages found. They appear after the first analysis. If a figure cannot be refreshed in a run, it keeps its value from the previous analysis until the next one, or until an administrator retries the Calculate Repository Statistics step.
  • Related repositories: the other repositories this one uses or is used by, for example Uses 12 calls, 3 copies.
  • Used by Systems: each System built from the repository, the part of it that System reads (Whole repository, or a path filter such as Include · 3 patterns), and whether the System is Current with the repository, Behind it, or Not built yet.
A repository's page on the Overview tab: the four tabs, the header with its auto-analysis schedule, Analyze, Edit connection and Delete, the Summary, the statistics, Related repositories.A repository's page on the Overview tab: the four tabs, the header with its auto-analysis schedule, Analyze, Edit connection and Delete, the Summary, the statistics, Related repositories.

The other tabs:

Administrators also get Analyze, Edit connection and Delete in the header. See Running system analysis.

One entry per repository and scope ​

A repository is identified by its type, its address and its analysis scope. Two addresses are the same when:

  • Git: the URL is the same. Letter case, a trailing slash, a trailing .git and a user name written into the URL make no difference.
  • SFTP: the server and the path on it are the same.

The same address can be added several times with different scopes, for example one entry for /batch and another for /online. Each entry is a separate repository, stored, analyzed and scheduled on its own.

An entry is refused when another entry at the same address already stores everything it would. That is the case when the other entry:

  • is Whole repository;
  • has the same scope;
  • uses Exclude and leaves out only patterns the new one also leaves out;
  • uses Include and takes in every pattern the new one takes in.

Pattern order, blank lines, comments and the letter case of the mode make no difference, except that when either scope has a ! pattern only the same scope in the same order counts. To show one System less of a repository, use that System's path filter instead.

A refused save leaves the editor open and says This repository already exists as “…” with an analysis scope that covers this one., with the name of the existing entry. Creating an entry, editing a connection and saving a scope are all checked this way. A wider scope than an existing entry is never refused. Repositories that were registered twice earlier keep working.

Connection details and credentials ​

TypeFieldsCredentials
GitURLAn Authentication choice: a saved credential, the repository's own access token, its own username and password, or none (public repository). If you set a username or a password, the other is required.
SFTPURL, PathA saved credential, or a username and password of its own (required).

For Git repositories, the credentials must grant read access to any git submodules the repository references. Credentials are stored securely, never inside the System itself.

To change a repository's name or connection details later, click Edit connection on its page. For a repository connected from this release onward, the URL is already filled in; for one connected earlier, enter it again. A repository's own credentials are never shown again, so re-enter them to keep them.

Saved credentials ​

A saved credential is entered once and used by as many repositories as you like, so you do not type the same credentials on every repository. Administrators manage them on the Credentials tab of the Repositories page.

The tab lists your organization's saved credentials. Each row shows the credential's name, its type, its host, how many repositories use it, and when it was last rotated.

A credential is one of:

  • An access token, for Git.
  • A username and password, for Git or SFTP.

A credential is tied to one host, for example github.com, and only repositories on that host can use it. Its secret is stored securely and is never shown again.

Create a credential

  1. On the Credentials tab, click New credential.
  2. Give it a Name, choose the Credential type (Access token or Username and password), enter the Host, and enter the token, or the username and password.
  3. Click Create credential.

Use it on a repository

When you connect or edit a repository, choose the saved credential under Authentication. The list offers only the credentials that match the repository's host. With a saved credential, the URL must not contain a user name, a password, a query string or a fragment, or the save is refused. The repository list then shows which credential each repository uses.

Rotate a credential

To change a secret, click Rotate on the credential's row. You enter the new secret once, and Nomain tests it against every repository that uses the credential. The result says which repositories are reachable and which failed. If the new secret reaches none of them, the previous secret is kept.

If the secure credential store denies access or cannot be reached, adding or editing a repository saves nothing. The dialog stays open and names the cause, and an administrator of your deployment must act. When a repository's own credentials are missing, enter them again with Edit connection and save; an analysis stopped by missing credentials says so in its job history.

Deleting a repository removes it everywhere

Delete, on a repository's page, removes its code, its analysis and its own credentials from Nomain, and takes it out of every System that used it. A saved credential it used stays, for the other repositories that use it. To take a repository out of one System only, remove it as a source instead.

Multi-repository Systems ​

A System can be built from several repositories, so related code held in separate repositories is understood as one connected whole. Choose one or more repositories when you create the System, and add or remove sources later from its Sources list.

References that cross repositories are connected. For example, a CICS file definition in one repository links to the programs and datasets that use it in another. Job steps, file definitions and the programs they call are connected across the whole System, not only within one repository.

Adding a source, editing its settings and removing it are administrator actions.

Path filters ​

A path filter decides which part of a repository a source brings into its System. It selects within what the repository's analysis scope stores, so it cannot bring back a path the scope leaves out. It has:

  • A mode: Include (only matching paths) or Exclude (everything except matching paths).
  • Patterns: gitignore-style patterns, one per line, for example /src or *.cbl. Blank lines and # comment lines are ignored.

Leave it as "No filter (whole repository)" to cover everything. A filter with no patterns also covers the whole repository.

Add default ignores adds the folders and files most repositories should leave out, such as dependencies, build output and generated code, and keeps them out in either mode.

You set a path filter when adding a source. To change or clear it later, open the Sources list on the System page and choose Edit source settings on the source's row. The System map and chat reflect the new selection as soon as you save. Lines of Code, Code Entities and Unused Code on the System page update at the System's next refresh.

Removing a source ​

An administrator can take a source out of a System without touching the repository behind it:

  1. On the System page, open the Sources list and choose Edit source settings on the source's row.
  2. Choose Remove source, then confirm with Remove source, or choose Keep source to leave it.
The Edit source settings dialog for one source: its path filter, the note on where secret scanning is set, and Remove source beside Cancel and Save.The Edit source settings dialog for one source: its path filter, the note on where secret scanning is set, and Remove source beside Cancel and Save.

The System is then refreshed without that source, and the run appears in its job history like any other.

Removal affects this System only. The repository and its connection stay, every other System built from it is unaffected, and existing chats stay readable. You can attach the repository again later with Add source.

Remove source is unavailable while the System is archived, or while it is Running, Queued or Waiting. A note beside it says why. The path filter stays editable.

Analysis scope ​

A repository's analysis scope is the part of it that Nomain stores and analyzes, for every System that uses it, now or later. It uses the same form as a path filter: a mode, Include (only matching paths) or Exclude (everything except matching paths), and gitignore-style patterns, one per line. Blank lines and # comment lines are ignored. Add default ignores keeps dependencies, build output and generated code out in either mode.

With no mode, or a mode with no patterns, the scope is Whole repository: everything is stored and analyzed. This is the default.

A file outside the scope is never stored and never analyzed. It does not appear in any System's map, search, chat answers or figures. For an SFTP repository, files outside the scope are not transferred. For a Git repository, they never reach Nomain's stored copy.

Set the scope when you add the repository, or later in the Analysis scope card on the Settings tab of the repository's page. The card shows the scope (Whole repository, or for example Exclude · 2 patterns) and whether it is Applied or Pending · applies with the next analysis. The editor has Mode, Patterns, Add default ignores and Save.

Saving a changed scope on a repository that has been analyzed starts an analysis of it, and the card reads Pending until that analysis has published. Narrowing the scope removes what is stored outside it. Widening it brings the newly covered files in. On a repository that was never analyzed, the scope is stored and reads Pending until its first analysis. Whole repository reads Applied.

A pattern that cannot be read is refused with the line named, for example Line 3: pattern cannot be read. A scope can have at most 200 patterns, each at most 256 characters.

Only administrators change an analysis scope. Every change is recorded in the audit log, with the mode and the number of patterns, never the patterns.

Files outside the scope are gone for every System

Files outside the scope are never stored or analysed, for every System that uses this repository. A program that copies a copybook or includes a member from outside it shows that member as unknown, as if it were missing from the repository. In Include mode, everything not listed is left out. Saving a change on an analysed repository starts an analysis.

Secret scanning ​

Nomain can scan a repository's code for committed secrets (API keys, tokens, credentials) and mask every finding before the code is analyzed. A masked secret never reaches any System, its explanations, or anything the assistant can search.

Scanning is off by default. An administrator turns it on with Scan this repository, in the Secret scanning card on the Settings tab of the repository's page. It covers every System that reads the repository, and is applied on the repository's next analysis.

The card shows whether scanning is Enabled or Disabled, and when the repository was last scanned. If a System's source settings also ask for the scan, the card names that System under Requested by, and Edit source settings on that System still shows Scan this repository for secrets so you can turn it off there.

Findings are listed in the analysis Job Log as rule: file:line, never with the secret value. Detection covers widely used secret formats and mainframe-specific ones: hardcoded passwords and credential literals in COBOL, PL/I and assembler sources, embedded SQL connection credentials, and CICS sign-on passwords.

Masking changes Nomain's copy of your code

Turning scanning on is deliberate: masking replaces each secret in the copy of your code that Nomain analyzes. Only the secret is replaced; line count and line endings stay the same. Your original repository is not altered.

Unused code detection ​

Nomain can check a repository for unused code: paragraphs, procedures and copybook inclusions that nothing in your analysed code calls or uses.

Detection is off by default for every repository, including repositories added before this setting existed. An administrator turns it on with Detect unused code in this repository, in the Unused code detection card on the Settings tab of the repository's page. The card shows Enabled or Disabled. While it is off, the card tells administrators: Off by default. Turning it on checks this repository right away.

A repository's Settings tab with the Auto-analysis, Secret scanning, Unused code detection and Analysis scope cards. The Unused code detection card shows Disabled, with its switch off.A repository's Settings tab with the Auto-analysis, Secret scanning, Unused code detection and Analysis scope cards. The Unused code detection card shows Disabled, with its switch off.
  • On: the repository is checked right away, with no new analysis, and again after each of its analyses.
  • Off: the repository has no unused code results. They are removed right away. The repository's Unused code figure reads Off, node details show no unused code section for its code, and in chat the assistant names the repositories it did not check instead of reporting them as free of unused code.

On a System, the Unused Code figure counts only the repositories that have detection on, and reads Off for N of M repositories when some have it off, or Off when none has it on. See Systems.

The result is only as complete as what you analyse

Detection works best when every repository that could call this one is analysed in Nomain. A program called only from code Nomain cannot see is reported as unused. Check before you delete anything.

In chat, an answer about unused code says what the check covered and what it cannot see, such as callers outside the System, and names the copybooks and includes a program copies that the System does not hold.

What Nomain reads ​

Nomain reads COBOL, PL/I, JCL, copybooks, CICS/BMS maps and CSD, DB2/DDL, and batch scheduler definitions (such as Control-M), plus application code in C#/.NET and JavaScript/TypeScript. See Supported languages & sources for the full list, and What to bring to Nomain for how to package a delivery so all of it is recognized.

To add functional documentation and data files (plain text, Markdown, PDF, Word, Excel, CSV and XML) without a code repository, use Document management.