feat: [PPT-2057] Added MCP Server controller #407
Crystal Ameba Results
Total files checked: 108
Issues found: 21
Ameba Version: 1.6.4
Crystal Version: 1.14.0
Annotations
Check warning on line 52 in src/placeos-rest-api/controllers/tenant_consent.cr
github-actions / Ameba
Lint/UselessAssign
Useless assignment to variable `visualiser_app_id`
Raw output
> visualiser_app_id = create_app(tenant_id)
^
Check notice on line 107 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> WITH total AS (
^
Check notice on line 108 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> SELECT COUNT(u.*) AS total_count
^
Check notice on line 109 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> FROM "#{table_name}" u
^
Check notice on line 110 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> #{where_clause}
^
Check notice on line 111 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> )
^
Check notice on line 112 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> SELECT u.*, t.total_count FROM "#{table_name}" u
^
Check notice on line 113 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> CROSS JOIN total t
^
Check notice on line 114 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> #{where_clause}
^
Check notice on line 115 in src/placeos-rest-api/controllers/uploads.cr
github-actions / Ameba
Layout/TrailingWhitespace
Trailing whitespace detected
Raw output
> LIMIT $#{limit_idx} OFFSET $#{offset_idx};
^
Check warning on line 15 in src/placeos-rest-api/utilities/current-user.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [13/10]
Raw output
> def authorize! : ::PlaceOS::Model::UserJWT
^
Check warning on line 207 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Lint/ShadowingOuterLocalVar
Shadowing outer local variable `type`
Raw output
> type = types.reject { |type| type.downcase == "null" }.first
^
Check warning on line 236 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Lint/UselessAssign
Useless assignment to variable `method`
Raw output
> method = params["name"]
^
Check warning on line 277 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Lint/UselessAssign
Useless assignment to variable `status_code`
Raw output
> response_text, status_code = remote_driver.exec(
^
Check warning on line 68 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Metrics/CyclomaticComplexity
Cyclomatic complexity too high [12/10]
Raw output
> def handler(
^
Check notice on line 283 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Style/RedundantReturn
Redundant `return` detected
Raw output
> return response_text
^
Check notice on line 22 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Style/VerboseBlock
Use short block notation instead: `any?(&.strip.starts_with?(CONTENT_TYPE_JSON))`
Raw output
> has_json = accept_types.any? { |media| media.strip.starts_with?(CONTENT_TYPE_JSON) }
^
Check notice on line 23 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Style/VerboseBlock
Use short block notation instead: `any?(&.strip.starts_with?(CONTENT_TYPE_SSE))`
Raw output
> has_sse = accept_types.any? { |media| media.strip.starts_with?(CONTENT_TYPE_SSE) }
^
Check notice on line 32 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Style/VerboseBlock
Use short block notation instead: `any?(&.strip.starts_with?(CONTENT_TYPE_SSE))`
Raw output
> has_sse = accept_types.any? { |media| media.strip.starts_with?(CONTENT_TYPE_SSE) }
^
Check notice on line 94 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Style/VerboseBlock
Use short block notation instead: `select(&.has_key?("error"))`
Raw output
> errors = messages.select { |msg| msg.has_key?("error") }
^
Check notice on line 205 in src/placeos-rest-api/controllers/mcp.cr
github-actions / Ameba
Style/VerboseBlock
Use short block notation instead: `map(&.["type"].as_s)`
Raw output
> types = any_of.as_a.map { |t| t["type"].as_s }
^