opensearch-project / security-dashboards-plugin
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 311 units with 5,855 lines of code in units (52.2% of code).
    • 12 very long units (2,051 lines of code)
    • 8 long units (564 lines of code)
    • 47 medium size units (1,494 lines of code)
    • 51 small units (734 lines of code)
    • 193 very small units (1,012 lines of code)
35% | 9% | 25% | 12% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx29% | 10% | 25% | 14% | 19%
ts43% | 8% | 25% | 8% | 13%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
public/apps29% | 10% | 25% | 14% | 19%
server/auth52% | 5% | 18% | 10% | 13%
server/routes86% | 0% | 0% | 9% | 4%
server/backend47% | 0% | 29% | 11% | 12%
server/multitenancy0% | 53% | 40% | 0% | 6%
public0% | 0% | 68% | 0% | 31%
server0% | 0% | 81% | 0% | 18%
public/services0% | 0% | 62% | 29% | 7%
server/session0% | 0% | 78% | 0% | 21%
ROOT0% | 0% | 0% | 100% | 0%
public/utils0% | 0% | 0% | 0% | 100%
server/utils0% | 0% | 0% | 0% | 100%
server/errors0% | 0% | 0% | 0% | 100%
common0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function defineRoutes()
in server/routes/index.ts
370 16 1
export function RoleView()
in public/apps/configuration/panels/role-view/role-view.tsx
224 10 1
export function TenantSwitchPanel()
in public/apps/account/tenant-switch-panel.tsx
198 25 1
public setupRoutes()
in server/auth/types/saml/routes.ts
194 17 0
public setupRoutes()
in server/auth/types/basic/routes.ts
174 11 0
export function UserList()
in public/apps/configuration/panels/user-list.tsx
151 8 1
export function RoleEdit()
in public/apps/configuration/panels/role-edit/role-edit.tsx
148 8 1
export function TenantList()
in public/apps/configuration/panels/tenant-list/tenant-list.tsx
129 9 1
export default function()
in server/backend/opensearch_security_configuration_plugin.ts
128 2 3
public setupRoutes()
in server/auth/types/openid/routes.ts
127 10 0
export function PermissionList()
in public/apps/configuration/panels/permission-list/permission-list.tsx
105 7 1
export function PasswordResetPanel()
in public/apps/account/password-reset-panel.tsx
103 5 1
export function LoginPage()
in public/apps/login/login-page.tsx
90 9 1
export function setupMultitenantRoutes()
in server/multitenancy/routes.ts
89 4 3
export function AuditLogging()
in public/apps/configuration/panels/audit-logging/audit-logging.tsx
82 5 1
export function TenantsPanel()
in public/apps/configuration/panels/role-view/tenants-panel.tsx
74 7 1
export function AccountNavButton()
in public/apps/account/account-nav-button.tsx
62 3 1
export function generateIndexPermissionPanels()
in public/apps/configuration/panels/role-edit/index-permission-panel.tsx
61 2 3
function resolve()
in server/multitenancy/tenant_resolver.ts
55 22 6
public setupRoutes()
in server/auth/types/proxy/routes.ts
51 4 0