before_code
stringlengths
30
149k
reviewer_comment
stringlengths
16
20.6k
after_code
stringlengths
30
163k
diff_context
stringlengths
0
22.4k
file_path
stringlengths
6
155
comment_line
int64
0
26
language
stringclasses
19 values
quality_score
float64
0.07
1
comment_type
stringclasses
9 values
comment_length
int64
16
20.6k
before_lines
int64
2
4.61k
after_lines
int64
2
4.4k
is_negative
bool
2 classes
pr_title
stringlengths
7
140
pr_number
int64
18
61.2k
repo_name
stringclasses
29 values
repo_stars
int64
321
56k
repo_language
stringclasses
14 values
reviewer_username
stringclasses
378 values
author_username
stringclasses
739 values
user
stringlengths
361
200k
assistant
stringlengths
16
20.6k
system
stringclasses
1 value
value={ conditions[0].accountPaths.length ? conditions[0].accountPaths.join(",") : "Not set" } /> </div> </div> <div> <div className="mb-3 border-b border-mineshaft-600 pb-2"> <h3 className="text-sm font-medium text-mineshaft-200">Ap...
No issues found.
value={ conditions[0].accountPaths.length ? conditions[0].accountPaths.join(",") : "Not set" } /> </div> </div> <div> <div className="mb-3 border-b border-mineshaft-600 pb-2"> <h3 className="text-sm font-medium text-mineshaft-200">Ap...
@@ -24,7 +24,7 @@ export const PolicyReviewStep = () => { const { data: members = [] } = useGetWorkspaceUsers(projectId); const { data: groups = [] } = useListWorkspaceGroups(projectId); - const { name, maxRequestTtl, conditions, constraints, steps } = watch(); + const { name, conditions, constraints, steps }...
frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyReviewStep.tsx
0
TypeScript
1
none
16
51
51
true
improvement(global-approvals): basic UI improvements
5,009
Infisical/infisical
22,351
TypeScript
x032205
Review this pull request change. Language: TypeScript File: frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyReviewStep.tsx PR Title: improvement(global-approvals): basic UI improvements BEFORE CODE: value={ conditions[0].accountPaths.length ? conditio...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
metadata: { certId: string; cn: string; serialNumber: string; }; } interface GetCertPrivateKey { type: EventType.GET_CERT_PRIVATE_KEY; metadata: { certId: string; cn: string; serialNumber: string; }; } interface GetCertBundle { type: EventType.GET_CERT_BUNDLE; metadata: { cer...
No issues found.
metadata: { certId: string; cn: string; serialNumber: string; }; } interface GetCertPrivateKey { type: EventType.GET_CERT_PRIVATE_KEY; metadata: { certId: string; cn: string; serialNumber: string; }; } interface GetCertBundle { type: EventType.GET_CERT_BUNDLE; metadata: { cer...
@@ -49,6 +49,7 @@ import { TWebhookPayloads } from "@app/services/webhook/webhook-types"; import { WorkflowIntegration } from "@app/services/workflow-integration/workflow-integration-types"; import { KmipPermission } from "../kmip/kmip-enum"; +import { AcmeChallengeType, AcmeIdentifierType } from "../pki-acme/pki-a...
backend/src/ee/services/audit-log/audit-log-types.ts
0
TypeScript
1
none
16
51
51
true
improvement(api): add acme audit logs
5,011
Infisical/infisical
22,351
TypeScript
fangpenlin
Review this pull request change. Language: TypeScript File: backend/src/ee/services/audit-log/audit-log-types.ts PR Title: improvement(api): add acme audit logs BEFORE CODE: metadata: { certId: string; cn: string; serialNumber: string; }; } interface GetCertPrivateKey { type: EventType.GET_CERT_P...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
import { PAM_RESOURCE_TYPE_MAP, TPamAccount } from "@app/hooks/api/pam"; import { LogInIcon, PackageOpenIcon } from "lucide-react"; type Props = { account: TPamAccount; onAccess: (resource: TPamAccount) => void; accountPath?: string; }; export const PamAccountCard = ({ account, onAccess, accountPath }: Props) =...
No issues found.
import { PAM_RESOURCE_TYPE_MAP, TPamAccount } from "@app/hooks/api/pam"; import { LogInIcon, PackageOpenIcon } from "lucide-react"; type Props = { account: TPamAccount; onAccess: (resource: TPamAccount) => void; accountPath?: string; }; export const PamAccountCard = ({ account, onAccess, accountPath }: Props) =...
@@ -0,0 +1,51 @@ +import { Badge, UnstableButton } from "@app/components/v3"; +import { PAM_RESOURCE_TYPE_MAP, TPamAccount } from "@app/hooks/api/pam"; +import { LogInIcon, PackageOpenIcon } from "lucide-react"; + +type Props = { + account: TPamAccount; + onAccess: (resource: TPamAccount) => void; + accountPath?: st...
frontend/src/pages/pam/PamAccountsPage/components/PamAccountCard.tsx
0
TypeScript
1
none
16
51
51
true
improvement(pam): cards for flat account view
5,016
Infisical/infisical
22,351
TypeScript
x032205
Review this pull request change. Language: TypeScript File: frontend/src/pages/pam/PamAccountsPage/components/PamAccountCard.tsx PR Title: improvement(pam): cards for flat account view BEFORE CODE: import { PAM_RESOURCE_TYPE_MAP, TPamAccount } from "@app/hooks/api/pam"; import { LogInIcon, PackageOpenIcon } from "l...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
url: "/runtime-ui-env.js", schema: { hide: true }, handler: (_req, res) => { void res.type("application/javascript"); const config = { CAPTCHA_SITE_KEY: appCfg.CAPTCHA_SITE_KEY, POSTHOG_API_KEY: appCfg.POSTHOG_PROJECT_API_KEY, INTERCOM_ID: appCfg.INTERCOM_ID, ...
No issues found.
url: "/runtime-ui-env.js", schema: { hide: true }, handler: (_req, res) => { void res.type("application/javascript"); const config = { CAPTCHA_SITE_KEY: appCfg.CAPTCHA_SITE_KEY, POSTHOG_API_KEY: appCfg.POSTHOG_PROJECT_API_KEY, INTERCOM_ID: appCfg.INTERCOM_ID, ...
@@ -1,6 +1,8 @@ +import fs from "node:fs"; import path from "node:path"; import staticServe from "@fastify/static"; +import RE2 from "re2"; import { getConfig, IS_PACKAGED } from "@app/lib/config/env"; @@ -15,6 +17,9 @@ export const registerServeUI = async ( dir: string; } ) => { + const appCfg = get...
backend/src/server/plugins/serve-ui.ts
0
TypeScript
1
none
16
51
51
true
feature(cdn): add optional CDN URL configuration for static assets in Vite
5,037
Infisical/infisical
22,351
TypeScript
victorvhs017
Review this pull request change. Language: TypeScript File: backend/src/server/plugins/serve-ui.ts PR Title: feature(cdn): add optional CDN URL configuration for static assets in Vite BEFORE CODE: url: "/runtime-ui-env.js", schema: { hide: true }, handler: (_req, res) => { void res.type(...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
requestData: { version: 1, requestData }, expiresAt }, tx ); const newSteps = await Promise.all( policy.steps.map(async (step, i) => { const stepNum = i + 1; const newStep = await approvalRequestStepsDAL.create( { req...
No issues found.
requestData: { version: 1, requestData }, expiresAt }, tx ); const newSteps = await Promise.all( policy.steps.map(async (step, i) => { const stepNum = i + 1; const newStep = await approvalRequestStepsDAL.create( { req...
@@ -31,6 +31,7 @@ import { import { APPROVAL_POLICY_FACTORY_MAP } from "./approval-policy-factory"; import { ApprovalPolicyStep, + TApprovalPolicyInputs, TApprovalRequest, TCreatePolicyDTO, TCreateRequestDTO, @@ -883,6 +884,36 @@ export const approvalPolicyServiceFactory = ({ return { grant: updated...
backend/src/services/approval-policy/approval-policy-service.ts
0
TypeScript
1
none
16
51
51
true
feature(pam): auto request access to accounts
5,050
Infisical/infisical
22,351
TypeScript
x032205
Review this pull request change. Language: TypeScript File: backend/src/services/approval-policy/approval-policy-service.ts PR Title: feature(pam): auto request access to accounts BEFORE CODE: requestData: { version: 1, requestData }, expiresAt }, tx ); const newStep...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
await deleteCa({ id, projectId: currentProject.id, type: CaType.INTERNAL }); createNotification({ text: "Successfully deleted CA", type: "success" }); handlePopUpClose("deleteCa"); }; const onUpdateCaStatus = async ({ caId, status }: { caId: string; status: CaStatus }) => { if (!...
No issues found.
await deleteCa({ id, projectId: currentProject.id, type: CaType.INTERNAL }); createNotification({ text: "Successfully deleted CA", type: "success" }); handlePopUpClose("deleteCa"); }; const onUpdateCaStatus = async ({ caId, status }: { caId: string; status: CaStatus }) => { if (!...
@@ -4,6 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { createNotification } from "@app/components/notifications"; import { ProjectPermissionCan } from "@app/components/permissions"; import { Button, DeleteActionModal } from "@app/components/v2"; +import { DocumentationLinkBadge } ...
frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx
0
TypeScript
1
none
16
51
51
true
feature: add PKI links to docs
5,058
Infisical/infisical
22,351
TypeScript
carlosmonastyrski
Review this pull request change. Language: TypeScript File: frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx PR Title: feature: add PKI links to docs BEFORE CODE: await deleteCa({ id, projectId: currentProject.id, type: CaType.INTERNAL }); createNotification({ text...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} const { additionalPrivilege: privilege } = await server.services.additionalPrivilege.updateAdditionalPrivilege({ permission: req.permission, scopeData: { scope: AccessScope.Project, projectId: data.privilege.projectId as string, orgId: req.permission.orgId ...
No issues found.
} const { additionalPrivilege: privilege } = await server.services.additionalPrivilege.updateAdditionalPrivilege({ permission: req.permission, scopeData: { scope: AccessScope.Project, projectId: data.privilege.projectId as string, orgId: req.permission.orgId ...
@@ -5,7 +5,7 @@ import { AccessScope, TemporaryPermissionMode } from "@app/db/schemas"; import { checkForInvalidPermissionCombination } from "@app/ee/services/permission/permission-fns"; import { ProjectPermissionV2Schema } from "@app/ee/services/permission/project-permission"; import { PROJECT_USER_ADDITIONAL_PRIVI...
backend/src/ee/routes/v1/user-additional-privilege-router.ts
0
TypeScript
1
none
16
51
51
true
feat(secrets-management): disallow editing privileges that were granted via access request
5,113
Infisical/infisical
22,351
TypeScript
x032205
Review this pull request change. Language: TypeScript File: backend/src/ee/routes/v1/user-additional-privilege-router.ts PR Title: feat(secrets-management): disallow editing privileges that were granted via access request BEFORE CODE: } const { additionalPrivilege: privilege } = await server.services.a...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
}, trx?: Knex ) => { const customerId = await licenseService.generateOrgCustomerId(orgName, userEmail); const createOrg = async (tx: Knex) => { // akhilmhdh: for now this is auto created. in future we can input from user and for previous users just modifiy const org = await orgDAL.create(...
No issues found.
}, trx?: Knex ) => { const customerId = await licenseService.generateOrgCustomerId(orgName, userEmail); const createOrg = async (tx: Knex) => { // akhilmhdh: for now this is auto created. in future we can input from user and for previous users just modifiy const org = await orgDAL.create(...
@@ -937,10 +937,25 @@ export const orgServiceFactory = ({ [`${TableName.Membership}.scopeOrgId` as "scopeOrgId"]: orgId }); - if (!orgMembership) + if (!orgMembership) { + // Check if user is already a member + const [acceptedMembership] = await orgDAL.findMembership({ + [`${TableNa...
backend/src/services/org/org-service.ts
0
TypeScript
1
none
16
51
51
true
feat: warn users when they're already part of an org and are trying to accept an invite
5,120
Infisical/infisical
22,351
TypeScript
x032205
Review this pull request change. Language: TypeScript File: backend/src/services/org/org-service.ts PR Title: feat: warn users when they're already part of an org and are trying to accept an invite BEFORE CODE: }, trx?: Knex ) => { const customerId = await licenseService.generateOrgCustomerId(orgName,...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
TCertificateRequests, TCertificateRequestsInsert, TCertificateRequestsUpdate >; [TableName.CertificateTemplate]: KnexOriginal.CompositeTableType< TCertificateTemplates, TCertificateTemplatesInsert, TCertificateTemplatesUpdate >; [TableName.PkiCertificateTemplateV2]: K...
No issues found.
TCertificateRequests, TCertificateRequestsInsert, TCertificateRequestsUpdate >; [TableName.CertificateTemplate]: KnexOriginal.CompositeTableType< TCertificateTemplates, TCertificateTemplatesInsert, TCertificateTemplatesUpdate >; [TableName.PkiCertificateTemplateV2]: K...
@@ -164,12 +164,6 @@ import { TGithubOrgSyncConfigs, TGithubOrgSyncConfigsInsert, TGithubOrgSyncConfigsUpdate, - TGroupProjectMembershipRoles, - TGroupProjectMembershipRolesInsert, - TGroupProjectMembershipRolesUpdate, - TGroupProjectMemberships, - TGroupProjectMembershipsInsert, - TGroupProjectMembershi...
backend/src/@types/knex.d.ts
0
TypeScript
1
none
16
51
51
true
chore: remove old membership tables
5,126
Infisical/infisical
22,351
TypeScript
akhilmhdh
Review this pull request change. Language: TypeScript File: backend/src/@types/knex.d.ts PR Title: chore: remove old membership tables BEFORE CODE: TCertificateRequests, TCertificateRequestsInsert, TCertificateRequestsUpdate >; [TableName.CertificateTemplate]: KnexOriginal.CompositeTableT...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
actorOrgId }); ForbiddenError.from(permission).throwUnlessCan(OrgPermissionKmipActions.Proxy, OrgPermissionSubjects.Kmip); const kmipClient = await kmipClientDAL.findOne({ id: clientId, projectId }); if (!kmipClient.permissions?.includes(KmipPermission.Activate)) { throw n...
No issues found.
actorOrgId }); ForbiddenError.from(permission).throwUnlessCan(OrgPermissionKmipActions.Proxy, OrgPermissionSubjects.Kmip); const kmipClient = await kmipClientDAL.findOne({ id: clientId, projectId }); if (!kmipClient.permissions?.includes(KmipPermission.Activate)) { throw n...
@@ -2,6 +2,7 @@ import { ForbiddenError } from "@casl/ability"; import { OrganizationActionScope } from "@app/db/schemas"; import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors"; +import { KmipOperationType, recordKmipOperationMetric } from "@app/lib/telemetry/metrics"; import { TK...
backend/src/ee/services/kmip/kmip-operation-service.ts
0
TypeScript
1
none
16
51
51
true
feat: add telemetry for kmip operations
5,129
Infisical/infisical
22,351
TypeScript
sheensantoscapadngan
Review this pull request change. Language: TypeScript File: backend/src/ee/services/kmip/kmip-operation-service.ts PR Title: feat: add telemetry for kmip operations BEFORE CODE: actorOrgId }); ForbiddenError.from(permission).throwUnlessCan(OrgPermissionKmipActions.Proxy, OrgPermissionSubjects.Kmip); ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
orgId, aliasType: org.orgAuthMethod === OrgAuthMethod.OIDC ? UserAliasType.OIDC : UserAliasType.SAML, userId: membership.actorUserId as string }, { externalId }, tx ); await membershipUserDAL.updateById( membership.id, ...
No issues found.
orgId, aliasType: org.orgAuthMethod === OrgAuthMethod.OIDC ? UserAliasType.OIDC : UserAliasType.SAML, userId: membership.actorUserId as string }, { externalId }, tx ); await membershipUserDAL.updateById( membership.id, ...
@@ -449,14 +449,26 @@ export const scimServiceFactory = ({ ); } } else { - user = await userDAL.findOne( + // we fetch all users with this email + const usersWithSameEmail = await userDAL.find( { - email: email.toLowerCase(), - isEmailVeri...
backend/src/ee/services/scim/scim-service.ts
0
TypeScript
1
none
16
51
51
true
fix: resolved scim service failing when there is already non joined email user
5,140
Infisical/infisical
22,351
TypeScript
akhilmhdh
Review this pull request change. Language: TypeScript File: backend/src/ee/services/scim/scim-service.ts PR Title: fix: resolved scim service failing when there is already non joined email user BEFORE CODE: orgId, aliasType: org.orgAuthMethod === OrgAuthMethod.OIDC ? UserAliasType.OIDC : UserAli...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
}, tx ); await userDAL.updateById( membership.actorUserId!, { firstName, email: email?.toLowerCase(), lastName, isEmailVerified: hasEmailChanged ? defaultEmailVerified : undefined }, tx ); }); return build...
No issues found.
}, tx ); await userDAL.updateById( membership.actorUserId!, { firstName, email: email?.toLowerCase(), lastName, isEmailVerified: hasEmailChanged ? defaultEmailVerified : undefined }, tx ); }); return build...
@@ -1006,7 +1006,8 @@ export const scimServiceFactory = ({ }, { groupName: displayName - } + }, + tx ); const [modifiedGroup] = await groupDAL.update( @@ -1016,26 +1017,35 @@ export const scimServiceFactory = ({ }, {...
backend/src/ee/services/scim/scim-service.ts
0
TypeScript
1
none
16
51
51
true
fix: updateScimGroup SCIM logic not handling multiple concurrent requests
5,145
Infisical/infisical
22,351
TypeScript
carlosmonastyrski
Review this pull request change. Language: TypeScript File: backend/src/ee/services/scim/scim-service.ts PR Title: fix: updateScimGroup SCIM logic not handling multiple concurrent requests BEFORE CODE: }, tx ); await userDAL.updateById( membership.actorUserId!, { ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
connectionTimeout: appCfg.isHsmConfigured ? 90_000 : 30_000, ignoreTrailingSlash: true, pluginTimeout: 40_000 }).withTypeProvider<ZodTypeProvider>(); server.setValidatorCompiler(validatorCompiler); server.setSerializerCompiler(serializerCompiler); // @ts-expect-error akhilmhdh: even on setting it...
No issues found.
connectionTimeout: appCfg.isHsmConfigured ? 90_000 : 30_000, ignoreTrailingSlash: true, pluginTimeout: 40_000 }).withTypeProvider<ZodTypeProvider>(); server.setValidatorCompiler(validatorCompiler); server.setSerializerCompiler(serializerCompiler); // @ts-expect-error akhilmhdh: even on setting it...
@@ -11,7 +11,7 @@ import helmet from "@fastify/helmet"; import type { FastifyRateLimitOptions } from "@fastify/rate-limit"; import ratelimiter from "@fastify/rate-limit"; import { fastifyRequestContext } from "@fastify/request-context"; -import fastify from "fastify"; +import fastify, { FastifyInstance, FastifyReque...
backend/src/server/app.ts
0
TypeScript
1
none
16
51
51
true
fix(agent-sentinel): improve OAuth metadata compatibility for MCP Inspector
5,192
Infisical/infisical
22,351
TypeScript
saifsmailbox98
Review this pull request change. Language: TypeScript File: backend/src/server/app.ts PR Title: fix(agent-sentinel): improve OAuth metadata compatibility for MCP Inspector BEFORE CODE: connectionTimeout: appCfg.isHsmConfigured ? 90_000 : 30_000, ignoreTrailingSlash: true, pluginTimeout: 40_000 }).wit...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
relayPkiServerCaCertificate: Buffer; relayPkiServerCaPrivateKey: Buffer; relayPkiClientCaCertificateChain: Buffer; relayPkiClientCaCertificate: Buffer; relaySshServerCaPrivateKey: Buffer; relaySshClientCaPublicKey: Buffer; orgId?: string; }) => { const alg = keyAlgorithmToAlgCfg(CertKe...
No issues found.
relayPkiServerCaCertificate: Buffer; relayPkiServerCaPrivateKey: Buffer; relayPkiClientCaCertificateChain: Buffer; relayPkiClientCaCertificate: Buffer; relaySshServerCaPrivateKey: Buffer; relaySshClientCaPublicKey: Buffer; orgId?: string; }) => { const alg = keyAlgorithmToAlgCfg(CertKe...
@@ -901,7 +901,10 @@ export const relayServiceFactory = ({ }); } - await verifyHostInputValidity(relay.host); + await verifyHostInputValidity({ + host: relay.host, + isDynamicSecret: false + }); if (relay.orgId === null) { const instanceCAs = await $getInstanceCAs(); @@ -9...
backend/src/ee/services/relay/relay-service.ts
0
TypeScript
1
none
16
51
51
true
feat: better host validation errors
5,208
Infisical/infisical
22,351
TypeScript
varonix0
Review this pull request change. Language: TypeScript File: backend/src/ee/services/relay/relay-service.ts PR Title: feat: better host validation errors BEFORE CODE: relayPkiServerCaCertificate: Buffer; relayPkiServerCaPrivateKey: Buffer; relayPkiClientCaCertificateChain: Buffer; relayPkiClientCaCer...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
}, [isEdit, profile, isAzureAdcsCa, azureAdcsTemplatesData, setValue]); const onFormSubmit = async (data: FormData) => { if (!currentProject?.id && !isEdit) return; // Validate Azure ADCS template requirement if ( isAzureAdcsCa && (!data.externalConfigs?.template || data.externalConfigs.te...
No issues found.
}, [isEdit, profile, isAzureAdcsCa, azureAdcsTemplatesData, setValue]); const onFormSubmit = async (data: FormData) => { if (!currentProject?.id && !isEdit) return; // Validate Azure ADCS template requirement if ( isAzureAdcsCa && (!data.externalConfigs?.template || data.externalConfigs.te...
@@ -87,7 +87,24 @@ const createSchema = z .object({ template: z.string().min(1, "Azure ADCS template is required") }) + .optional(), + defaultTtl: z + .object({ + value: z.number().min(1, "Duration must be at least 1").nullable().optional(), + unit: z.enum(["days", "mon...
frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx
0
TypeScript
1
none
16
51
51
true
feat(pki): add default TTL setting to certificate profiles
5,238
Infisical/infisical
22,351
TypeScript
saifsmailbox98
Review this pull request change. Language: TypeScript File: frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx PR Title: feat(pki): add default TTL setting to certificate profiles BEFORE CODE: }, [isEdit, profile, isAzureAdcsCa, azureAdcsTemplatesData, setValue])...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
const projectEnvService = projectEnvServiceFactory({ permissionService, projectEnvDAL, keyStore, licenseService, projectDAL, folderDAL, accessApprovalPolicyEnvironmentDAL, secretApprovalPolicyEnvironmentDAL: sapEnvironmentDAL }); const snapshotService = secretSnapshotServiceFacto...
No issues found.
const projectEnvService = projectEnvServiceFactory({ permissionService, projectEnvDAL, keyStore, licenseService, projectDAL, folderDAL, accessApprovalPolicyEnvironmentDAL, secretApprovalPolicyEnvironmentDAL: sapEnvironmentDAL }); const snapshotService = secretSnapshotServiceFacto...
@@ -942,7 +942,8 @@ export const registerRoutes = async ( auditLogService, notificationService, membershipRoleDAL, - membershipUserDAL + membershipUserDAL, + keyStore }); const passwordService = authPaswordServiceFactory({ tokenService,
backend/src/server/routes/index.ts
0
TypeScript
1
none
16
51
51
true
improvement(mfa): implement MFA unlock email handling with keystore lockout mechanism
5,239
Infisical/infisical
22,351
TypeScript
victorvhs017
Review this pull request change. Language: TypeScript File: backend/src/server/routes/index.ts PR Title: improvement(mfa): implement MFA unlock email handling with keystore lockout mechanism BEFORE CODE: const projectEnvService = projectEnvServiceFactory({ permissionService, projectEnvDAL, keyStore, ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
import { Knex } from "knex"; import { TableName } from "../schemas"; export async function up(knex: Knex): Promise<void> { const hasIdentityCreationLimitCol = await knex.schema.hasColumn(TableName.RateLimit, "identityCreationLimit"); const hasProjectCreationLimitCol = await knex.schema.hasColumn(TableName.RateLim...
No issues found.
import { Knex } from "knex"; import { TableName } from "../schemas"; export async function up(knex: Knex): Promise<void> { const hasIdentityCreationLimitCol = await knex.schema.hasColumn(TableName.RateLimit, "identityCreationLimit"); const hasProjectCreationLimitCol = await knex.schema.hasColumn(TableName.RateLim...
@@ -0,0 +1,31 @@ +import { Knex } from "knex"; + +import { TableName } from "../schemas"; + +export async function up(knex: Knex): Promise<void> { + const hasIdentityCreationLimitCol = await knex.schema.hasColumn(TableName.RateLimit, "identityCreationLimit"); + const hasProjectCreationLimitCol = await knex.schema.has...
backend/src/db/migrations/20260123144431_add-identity-project-creation-rate-limits.ts
0
TypeScript
1
none
16
32
32
true
fix(identities-projects): add lock to identity insert and custom rate-limitings for identities and projects creation
5,242
Infisical/infisical
22,351
TypeScript
victorvhs017
Review this pull request change. Language: TypeScript File: backend/src/db/migrations/20260123144431_add-identity-project-creation-rate-limits.ts PR Title: fix(identities-projects): add lock to identity insert and custom rate-limitings for identities and projects creation BEFORE CODE: import { Knex } from "knex"; ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (identityMembershipOrg.identity.projectId) { const { permission } = await permissionService.getProjectPermission({ actionProjectType: ActionProjectType.Any, actor, actorId, projectId: identityMembershipOrg.identity.projectId, actorAuthMethod, actorOrgId ...
No issues found.
if (identityMembershipOrg.identity.projectId) { const { permission } = await permissionService.getProjectPermission({ actionProjectType: ActionProjectType.Any, actor, actorId, projectId: identityMembershipOrg.identity.projectId, actorAuthMethod, actorOrgId ...
@@ -67,7 +67,7 @@ export const identityAliCloudAuthServiceFactory = ({ permissionService, orgDAL }: TIdentityAliCloudAuthServiceFactoryDep) => { - const login = async ({ identityId, subOrganizationName, ...params }: TLoginAliCloudAuthDTO) => { + const login = async ({ identityId, organizationSlug, ...params }:...
backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts
0
TypeScript
1
none
16
51
51
true
feat: updated identity login endpoints suborganization paramater to organizationSlug
5,281
Infisical/infisical
22,351
TypeScript
akhilmhdh
Review this pull request change. Language: TypeScript File: backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts PR Title: feat: updated identity login endpoints suborganization paramater to organizationSlug BEFORE CODE: if (identityMembershipOrg.identity.projectId) { const { per...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
logger.info("Skipping sanitized schema generation: another instance is currently generating the schema"); } return res?.rows[0]?.lock_acquired; }; export const dropSanitizedSchema = async ({ db, logger }: TArgs): Promise<void> => { await db.raw(`DROP SCHEMA IF EXISTS "${SANITIZED_SCHEMA}" CASCADE`); logger...
No issues found.
logger.info("Skipping sanitized schema generation: another instance is currently generating the schema"); } return res?.rows[0]?.lock_acquired; }; export const dropSanitizedSchema = async ({ db, logger }: TArgs): Promise<void> => { await db.raw(`DROP SCHEMA IF EXISTS "${SANITIZED_SCHEMA}" CASCADE`); logger...
@@ -53,14 +53,18 @@ const validateGeneratedSQL = (sql: string): void => { }; export const createSanitizedSchema = async ({ db, logger }: TArgs): Promise<void> => { - // eslint-disable-next-line import/no-extraneous-dependencies + // eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no...
backend/src/db/sanitized-schema.ts
0
TypeScript
1
none
16
51
51
true
fix(api): ensure commits are linted/formatted before commit
5,282
Infisical/infisical
22,351
TypeScript
IgorHorta
Review this pull request change. Language: TypeScript File: backend/src/db/sanitized-schema.ts PR Title: fix(api): ensure commits are linted/formatted before commit BEFORE CODE: logger.info("Skipping sanitized schema generation: another instance is currently generating the schema"); } return res?.rows[0]?.l...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} }, [onSecretDelete, environment, secretName, secretId, reset, setIsDeleting]); const canCreate = permission.can( ProjectPermissionSecretActions.Create, subject(ProjectPermissionSub.Secrets, { environment, secretPath, secretName, secretTags: ["*"] }) ); const isReadOnl...
No issues found.
} }, [onSecretDelete, environment, secretName, secretId, reset, setIsDeleting]); const canCreate = permission.can( ProjectPermissionSecretActions.Create, subject(ProjectPermissionSub.Secrets, { environment, secretPath, secretName, secretTags: ["*"] }) ); const isReadOnl...
@@ -6,6 +6,7 @@ import { CopyIcon, EditIcon, EyeOffIcon, + MessageSquareIcon, SaveIcon, TrashIcon, Undo2Icon, @@ -18,7 +19,15 @@ import { ProjectPermissionCan } from "@app/components/permissions"; import { SecretReferenceTree } from "@app/components/secrets/SecretReferenceDetails"; import { DeleteA...
frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx
0
TypeScript
1
none
16
51
51
true
feature: add secret comment support to overview page
5,319
Infisical/infisical
22,351
TypeScript
scott-ray-wilson
Review this pull request change. Language: TypeScript File: frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx PR Title: feature: add secret comment support to overview page BEFORE CODE: } }, [onSecretDelete, environment, secretName, secretId, reset, setIsDeleting]...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/> ) : ( <KeyIcon className={twMerge("block text-secret group-hover:!hidden", isSelected && "!hidden")} /> )} </UnstableTableCell> <UnstableTableCell isTruncatable className={twMerge( "sticky left-10 z-...
No issues found.
/> ) : ( <KeyIcon className={twMerge("block text-secret group-hover:!hidden", isSelected && "!hidden")} /> )} </UnstableTableCell> <UnstableTableCell isTruncatable className={twMerge( "sticky left-10 z-...
@@ -346,6 +346,7 @@ export const SecretTableRow = ({ comment={secret?.comment} tags={secret?.tags} secretMetadata={secret?.secretMetadata} + skipMultilineEncoding={secret?.skipMultilineEncoding} ...
frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
0
TypeScript
1
none
16
51
51
true
feature(frontend): toggle multi-line encoding from overview page
5,338
Infisical/infisical
22,351
TypeScript
scott-ray-wilson
Review this pull request change. Language: TypeScript File: frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx PR Title: feature(frontend): toggle multi-line encoding from overview page BEFORE CODE: /> ) : ( <KeyIcon className=...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
), closed: parseInt( (docs.find(({ status }) => status === RequestState.Closed) as { count: string })?.count || "0", 10 ) }; } catch (error) { throw new DatabaseError({ error, name: "FindRequestCount" }); } }; const findByProjectId = async ( { sta...
No issues found.
), closed: parseInt( (docs.find(({ status }) => status === RequestState.Closed) as { count: string })?.count || "0", 10 ) }; } catch (error) { throw new DatabaseError({ error, name: "FindRequestCount" }); } }; const findByProjectId = async ( { sta...
@@ -20,7 +20,7 @@ export type TSecretApprovalRequestDALFactory = ReturnType<typeof secretApprovalR type TFindQueryFilter = { projectId: string; - userId: string; + userId?: string; status?: RequestState; environment?: string; committer?: string; @@ -29,6 +29,47 @@ type TFindQueryFilter = { search?: ...
backend/src/ee/services/secret-approval-request/secret-approval-request-dal.ts
0
TypeScript
1
none
16
51
51
true
fix(ui): add secret approval request role to allow users view CR other than theirs
5,345
Infisical/infisical
22,351
TypeScript
IgorHorta
Review this pull request change. Language: TypeScript File: backend/src/ee/services/secret-approval-request/secret-approval-request-dal.ts PR Title: fix(ui): add secret approval request role to allow users view CR other than theirs BEFORE CODE: ), closed: parseInt( (docs.find(({ status }) ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
reset({ name: currentOrg.name || "", slug: currentOrg.slug || "" }); } }, [currentOrg?.id, currentOrg?.name, currentOrg?.slug, reset]); const { mutateAsync, isPending } = useUpdateSubOrganization(); const onFormSubmit = async ({ name, slug }: FormData) => { await mutateAsync(...
No issues found.
reset({ name: currentOrg.name || "", slug: currentOrg.slug || "" }); } }, [currentOrg?.id, currentOrg?.name, currentOrg?.slug, reset]); const { mutateAsync, isPending } = useUpdateSubOrganization(); const onFormSubmit = async ({ name, slug }: FormData) => { await mutateAsync(...
@@ -1,3 +1,4 @@ +import { useEffect } from "react"; import { Controller, useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { useQueryClient } from "@tanstack/react-query"; @@ -14,11 +15,11 @@ import { useOrgPermission } from "@app/context"; import { useUpdateSubOrga...
frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx
0
TypeScript
1
none
16
51
51
true
feature(api): add display name support for sub-organizations
5,362
Infisical/infisical
22,351
TypeScript
IgorHorta
Review this pull request change. Language: TypeScript File: frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx PR Title: feature(api): add display name support for sub-organizations BEFORE CODE: reset({ name: currentOrg.name || "", slug: cu...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
secretReminderRecipients?: string[] | null; metadata?: { source?: string; }; secretMetadata?: ResourceMetadataWithEncryptionDTO; }; export type TDeleteSecretRawDTO = TProjectPermission & { secretPath: string; environment: string; secretName: string; type: SecretType; }; export type TCreateManySecr...
No issues found.
secretReminderRecipients?: string[] | null; metadata?: { source?: string; }; secretMetadata?: ResourceMetadataWithEncryptionDTO; }; export type TDeleteSecretRawDTO = TProjectPermission & { secretPath: string; environment: string; secretName: string; type: SecretType; }; export type TCreateManySecr...
@@ -68,7 +68,7 @@ export type TCreateSecretDTO = { secretCommentCiphertext?: string; secretCommentIV?: string; secretCommentTag?: string; - skipMultilineEncoding?: boolean; + skipMultilineEncoding?: boolean | null; secretReminderRepeatDays?: number | null; secretReminderNote?: string | null; tags?: ...
backend/src/services/secret/secret-types.ts
0
TypeScript
1
none
16
51
51
true
fix(secrets): resolve rename validation error for skipMultilineEncoding
5,379
Infisical/infisical
22,351
TypeScript
IgorHorta
Review this pull request change. Language: TypeScript File: backend/src/services/secret/secret-types.ts PR Title: fix(secrets): resolve rename validation error for skipMultilineEncoding BEFORE CODE: secretReminderRecipients?: string[] | null; metadata?: { source?: string; }; secretMetadata?: ResourceMet...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
"backupPrivateKey", "secretKey", "SecretKey", "botPrivateKey", "encryptedKey", "plaintextProjectKey", "accessKey", "botKey", "decryptedSecret", "secrets", "key", "password", "config", "bindPass", "bindDN", "x-vault-token", "X-VAULT-TOKEN" ]; const UNKNOWN_REQUEST_ID = "UNKNOWN_REQUEST...
No issues found.
"backupPrivateKey", "secretKey", "SecretKey", "botPrivateKey", "encryptedKey", "plaintextProjectKey", "accessKey", "botKey", "decryptedSecret", "secrets", "key", "password", "config", "bindPass", "bindDN", "x-vault-token", "X-VAULT-TOKEN" ]; const UNKNOWN_REQUEST_ID = "UNKNOWN_REQUEST...
@@ -86,7 +86,9 @@ const redactedKeys = [ "password", "config", "bindPass", - "bindDN" + "bindDN", + "x-vault-token", + "X-VAULT-TOKEN" ]; const UNKNOWN_REQUEST_ID = "UNKNOWN_REQUEST_ID"; @@ -179,7 +181,14 @@ export const initLogger = () => { }) }, // redact until depth of three -...
backend/src/lib/logger/logger.ts
0
TypeScript
1
none
16
51
51
true
feat: added logger to vault app connection for debug
5,403
Infisical/infisical
22,351
TypeScript
akhilmhdh
Review this pull request change. Language: TypeScript File: backend/src/lib/logger/logger.ts PR Title: feat: added logger to vault app connection for debug BEFORE CODE: "backupPrivateKey", "secretKey", "SecretKey", "botPrivateKey", "encryptedKey", "plaintextProjectKey", "accessKey", "botKey", "dec...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
warning: "border-warning/25 bg-warning/10 text-foreground hover:bg-warning/15 hover:border-warning/30", danger: "border-danger/25 bg-danger/10 text-foreground hover:bg-danger/15 hover:border-danger/30" }, size: { xs: "h-7 w-7 [&>svg]:size-4 rounded-sm [&>svg]:stro...
No issues found.
warning: "border-warning/25 bg-warning/10 text-foreground hover:bg-warning/15 hover:border-warning/30", danger: "border-danger/25 bg-danger/10 text-foreground hover:bg-danger/15 hover:border-danger/30" }, size: { xs: "h-7 w-7 [&>svg]:size-4 rounded-sm [&>svg]:stro...
@@ -10,7 +10,8 @@ import { cn } from "@app/components/v3/utils"; const iconButtonVariants = cva( cn( "inline-flex items-center active:scale-[0.99] justify-center border cursor-pointer whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointe...
frontend/src/components/v3/generic/IconButton/IconButton.tsx
0
TypeScript
1
none
16
51
51
true
feat(frontend): add secret share action to overview page
5,426
Infisical/infisical
22,351
TypeScript
scott-ray-wilson
Review this pull request change. Language: TypeScript File: frontend/src/components/v3/generic/IconButton/IconButton.tsx PR Title: feat(frontend): add secret share action to overview page BEFORE CODE: warning: "border-warning/25 bg-warning/10 text-foreground hover:bg-warning/15 hover:border-warnin...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
actor, actorId, projectId: filter.projectId, actorAuthMethod, actorOrgId, actionProjectType: ActionProjectType.Any }); ForbiddenError.from(permission).throwUnlessCan( ProjectPermissionAuditLogsActions.Read, ProjectPermissionSub.AuditLogs ...
No issues found.
actor, actorId, projectId: filter.projectId, actorAuthMethod, actorOrgId, actionProjectType: ActionProjectType.Any }); ForbiddenError.from(permission).throwUnlessCan( ProjectPermissionAuditLogsActions.Read, ProjectPermissionSub.AuditLogs ...
@@ -4,23 +4,27 @@ import { requestContext } from "@fastify/request-context"; import { ActionProjectType, OrganizationActionScope } from "@app/db/schemas"; import { getConfig } from "@app/lib/config/env"; import { BadRequestError } from "@app/lib/errors"; +import { logger } from "@app/lib/logger"; import { ActorType...
backend/src/ee/services/audit-log/audit-log-service.ts
0
TypeScript
1
none
16
51
51
true
improvement(api): query audit logs with clickhouse
5,463
Infisical/infisical
22,351
TypeScript
fangpenlin
Review this pull request change. Language: TypeScript File: backend/src/ee/services/audit-log/audit-log-service.ts PR Title: improvement(api): query audit logs with clickhouse BEFORE CODE: actor, actorId, projectId: filter.projectId, actorAuthMethod, actorOrgId, actio...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
try { await listHCVaultPolicies(namespace, connection, gatewayService, gatewayV2Service, gatewayDetails); await getHCVaultAuthMounts( namespace, HCVaultAuthType.Kubernetes, connection, gatewayService, gatewayV2Service, gatewayDetails ); const...
No issues found.
try { await listHCVaultPolicies(namespace, connection, gatewayService, gatewayV2Service, gatewayDetails); await getHCVaultAuthMounts( namespace, HCVaultAuthType.Kubernetes, connection, gatewayService, gatewayV2Service, gatewayDetails ); const...
@@ -5,12 +5,14 @@ import { SecretApprovalEvent, TAuditLogServiceFactory } from "@app/ee/services/audit-log/audit-log-types"; +import { verifyHostInputValidity } from "@app/ee/services/dynamic-secret/dynamic-secret-fns"; import { TGatewayServiceFactory } from "@app/ee/services/gateway/gateway-service"; import {...
backend/src/services/external-migration/external-migration-service.ts
0
TypeScript
1
none
16
51
51
true
feat(vault): reusable gateway
5,481
Infisical/infisical
22,351
TypeScript
varonix0
Review this pull request change. Language: TypeScript File: backend/src/services/external-migration/external-migration-service.ts PR Title: feat(vault): reusable gateway BEFORE CODE: try { await listHCVaultPolicies(namespace, connection, gatewayService, gatewayV2Service, gatewayDetails); await getH...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
> <Input isDisabled={isUpdate} value={value} onChange={onChange} placeholder="appuser" /> </FormControl> )} /> {!isUpdate && rotationMethod === UnixLinuxLocalAccountRotationMetho...
No issues found.
> <Input isDisabled={isUpdate} value={value} onChange={onChange} placeholder="appuser" /> </FormControl> )} /> {!isUpdate && rotationMethod === UnixLinuxLocalAccountRotationMetho...
@@ -2,7 +2,7 @@ import { Controller, useFormContext } from "react-hook-form"; import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas"; import { DEFAULT_PASSWORD_REQUIREMENTS } from "@app/components/secret-rotations-v2/forms/schemas/shared"; -import { FormControl, Input, Select, Sel...
frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/UnixLinuxLocalAccountRotationParametersFields.tsx
0
TypeScript
1
none
16
51
51
true
feat: removed the check in rotation and also added useSudo capability in unix linux account rotation
5,495
Infisical/infisical
22,351
TypeScript
akhilmhdh
Review this pull request change. Language: TypeScript File: frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/UnixLinuxLocalAccountRotationParametersFields.tsx PR Title: feat: removed the check in rotation and also added useSudo capability in unix linux account rotation BEFORE CODE:...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
Two booleans in parameters almost always look bad because it's difficult to read such code. It's better to provide static constructors like ReplaceCallFix.toDotCall(), ReplaceCallFix.toQuestionMarkCall(), ReplaceCallFix.toExclamationCall(). Another alternative is to create and pass as parameter some enumeration.
/* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
@@ -133,8 +133,12 @@ private QuickFixes() {} actions.put(VAL_WITH_SETTER, changeVariableMutabilityFix); actions.put(VAL_REASSIGNMENT, changeVariableMutabilityFix); - actions.put(UNNECESSARY_SAFE_CALL, new ReplaceCallFix(false)); - actions.put(UNSAFE_CALL, new ReplaceCallFix(true)); + ...
idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java
0
Java
0.5
suggestion
314
145
147
false
Fix for KT-2174 Need "Replace with unsafe call" intention
80
JetBrains/kotlin
51,705
Kotlin
goodwinnk
Frostman
Review this pull request change. Language: Java File: idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java PR Title: Fix for KT-2174 Need "Replace with unsafe call" intention BEFORE CODE: /* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you ma...
Two booleans in parameters almost always look bad because it's difficult to read such code. It's better to provide static constructors like ReplaceCallFix.toDotCall(), ReplaceCallFix.toQuestionMarkCall(), ReplaceCallFix.toExclamationCall(). Another alternative is to create and pass as parameter some enumeration.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
* * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the Licen...
I understand why you decided to create another class for that task but still think that there should be another logic in UnnecessaryNotNullAssertionFix and ReplaceCallFix. I propose ReplaceCallFix could also be used for replacing !!. call to something else as it can be used for introducing such calls now. And this clas...
* * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the Licen...
@@ -0,0 +1,73 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless require...
idea/src/org/jetbrains/jet/plugin/quickfix/UnnecessaryNotNullAssertionFix.java
26
Java
0.643
question
423
51
51
false
Fix for KT-2174 Need "Replace with unsafe call" intention
80
JetBrains/kotlin
51,705
Kotlin
goodwinnk
Frostman
Review this pull request change. Language: Java File: idea/src/org/jetbrains/jet/plugin/quickfix/UnnecessaryNotNullAssertionFix.java PR Title: Fix for KT-2174 Need "Replace with unsafe call" intention BEFORE CODE: * * Unless required by applicable law or agreed to in writing, software * distributed under the Lic...
I understand why you decided to create another class for that task but still think that there should be another logic in UnnecessaryNotNullAssertionFix and ReplaceCallFix. I propose ReplaceCallFix could also be used for replacing !!. call to something else as it can be used for introducing such calls now. And this clas...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
Ok, I will add static constructors.
/* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
@@ -133,8 +133,12 @@ private QuickFixes() {} actions.put(VAL_WITH_SETTER, changeVariableMutabilityFix); actions.put(VAL_REASSIGNMENT, changeVariableMutabilityFix); - actions.put(UNNECESSARY_SAFE_CALL, new ReplaceCallFix(false)); - actions.put(UNSAFE_CALL, new ReplaceCallFix(true)); + ...
idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java
0
Java
0.071
suggestion
36
145
147
false
Fix for KT-2174 Need "Replace with unsafe call" intention
80
JetBrains/kotlin
51,705
Kotlin
Frostman
Frostman
Review this pull request change. Language: Java File: idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java PR Title: Fix for KT-2174 Need "Replace with unsafe call" intention BEFORE CODE: /* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you ma...
Ok, I will add static constructors.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
* * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the Licen...
ReplaceCallFix is used for replacing !!. now. I will rename UnnecessaryNonNullAssertionFix to PostfixNonNullAssertionFix and will implement removing of a!! postfix operation. Additionally I will try to implement introducing of !! postfix operation.
* * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the Licen...
@@ -0,0 +1,73 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless require...
idea/src/org/jetbrains/jet/plugin/quickfix/UnnecessaryNotNullAssertionFix.java
26
Java
0.643
suggestion
249
51
51
false
Fix for KT-2174 Need "Replace with unsafe call" intention
80
JetBrains/kotlin
51,705
Kotlin
Frostman
Frostman
Review this pull request change. Language: Java File: idea/src/org/jetbrains/jet/plugin/quickfix/UnnecessaryNotNullAssertionFix.java PR Title: Fix for KT-2174 Need "Replace with unsafe call" intention BEFORE CODE: * * Unless required by applicable law or agreed to in writing, software * distributed under the Lic...
ReplaceCallFix is used for replacing !!. now. I will rename UnnecessaryNonNullAssertionFix to PostfixNonNullAssertionFix and will implement removing of a!! postfix operation. Additionally I will try to implement introducing of !! postfix operation.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
Both quick fixes are available for this code snippet: fun test(value : String) : String { return value!!.toString() } I suggest to forbid one from UnnecessaryNotNullAssertionFix if warning is in the middle of DOT_QUALIFIED_EXPRESSION. By the way, Sergey, what tools do you use for monitoring PSI tree. I don't rememb...
factories.put(INITIALIZATION_USING_BACKING_FIELD_OPEN_SETTER, changeToBackingFieldFactory); JetIntentionActionFactory unresolvedReferenceFactory = ImportClassAndFunFix.createFactory(); factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory); factories.put(SUPERTYPE_NOT_INITIALI...
@@ -133,8 +133,14 @@ private QuickFixes() {} actions.put(VAL_WITH_SETTER, changeVariableMutabilityFix); actions.put(VAL_REASSIGNMENT, changeVariableMutabilityFix); - actions.put(UNNECESSARY_SAFE_CALL, new ReplaceCallFix(false)); - actions.put(UNSAFE_CALL, new ReplaceCallFix(true)); + ...
idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java
26
Java
0.643
question
387
140
31
false
Fix for KT-2174 Need "Replace with unsafe call" intention
80
JetBrains/kotlin
51,705
Kotlin
goodwinnk
Frostman
Review this pull request change. Language: Java File: idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java PR Title: Fix for KT-2174 Need "Replace with unsafe call" intention BEFORE CODE: /* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you ma...
Both quick fixes are available for this code snippet: fun test(value : String) : String { return value!!.toString() } I suggest to forbid one from UnnecessaryNotNullAssertionFix if warning is in the middle of DOT_QUALIFIED_EXPRESSION. By the way, Sergey, what tools do you use for monitoring PSI tree. I don't rememb...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
I used debug for monitoring / researching PSI tree and I don't now about View PSI tool :( Thank you for this tip.
factories.put(INITIALIZATION_USING_BACKING_FIELD_OPEN_SETTER, changeToBackingFieldFactory); JetIntentionActionFactory unresolvedReferenceFactory = ImportClassAndFunFix.createFactory(); factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory); factories.put(SUPERTYPE_NOT_INITIALI...
@@ -133,8 +133,14 @@ private QuickFixes() {} actions.put(VAL_WITH_SETTER, changeVariableMutabilityFix); actions.put(VAL_REASSIGNMENT, changeVariableMutabilityFix); - actions.put(UNNECESSARY_SAFE_CALL, new ReplaceCallFix(false)); - actions.put(UNSAFE_CALL, new ReplaceCallFix(true)); + ...
idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java
26
Java
0.571
bug
114
140
31
false
Fix for KT-2174 Need "Replace with unsafe call" intention
80
JetBrains/kotlin
51,705
Kotlin
Frostman
Frostman
Review this pull request change. Language: Java File: idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java PR Title: Fix for KT-2174 Need "Replace with unsafe call" intention BEFORE CODE: /* * Copyright 2010-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you ma...
I used debug for monitoring / researching PSI tree and I don't now about View PSI tool :( Thank you for this tip.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
jvmLocalDeclarationsPhase then singleAbstractMethodPhase then callableReferencePhase then functionNVarargInvokePhase then innerClassesPhase then innerClassConstructorCallsPhase then forLoopsPhase then makePatchParentsPhase...
I wanted to add this for JS but I don't know how to test it. Would appreciate a pointer so I can follow-up. And for native I assume I wait until they update to a version of compiler that contains this phase and then I can update their list?
jvmLocalDeclarationsPhase then singleAbstractMethodPhase then callableReferencePhase then functionNVarargInvokePhase then innerClassesPhase then innerClassConstructorCallsPhase then forLoopsPhase then makePatchParentsPhase...
@@ -107,6 +107,7 @@ val jvmPhases = namedIrFilePhase( jvmTypeOperatorLoweringPhase then foldConstantLoweringPhase then flattenStringConcatenationPhase then + computeStringTrimPhase then
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt
26
Kotlin
0.429
question
243
41
41
false
IR lowering for computing trimIndent/trimMargin on constants
2,290
JetBrains/kotlin
51,705
Kotlin
JakeWharton
JakeWharton
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt PR Title: IR lowering for computing trimIndent/trimMargin on constants BEFORE CODE: jvmLocalDeclarationsPhase then singleAbstractMethodPhase then calla...
I wanted to add this for JS but I don't know how to test it. Would appreciate a pointer so I can follow-up. And for native I assume I wait until they update to a version of compiler that contains this phase and then I can update their list?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
private fun maybeComputeTrimIndent(call: IrCall): IrExpression { val receiverString = call.extensionReceiver!!.toConstantString() ?: return call val newString = receiverString.trimIndent() return IrConstImpl.string(call.startOffset, call.endOffset, call.type, newString) } private f...
I feel like this should be its own lowering phase for all platforms. Currently this phase gets IR like: ``` $receiver: STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value="\n |Hello,\n |" CONST String type=kotlin.String value="Hello,\n |World" CONST String type=...
else -> super.visitCall(expression) } } private fun maybeComputeTrimIndent(call: IrCall): IrExpression { val receiverString = call.extensionReceiver!!.getConstantString() ?: return call val newString = receiverString.trimIndent() return IrConstImpl.string(call.startO...
@@ -0,0 +1,100 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.backend.common.lower + +import org.jetbrains.kotlin.backend.common.CommonBackendContext +import org.jet...
compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/StringTrimLowering.kt
26
Kotlin
1
suggestion
442
51
50
false
IR lowering for computing trimIndent/trimMargin on constants
2,290
JetBrains/kotlin
51,705
Kotlin
JakeWharton
JakeWharton
Review this pull request change. Language: Kotlin File: compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/StringTrimLowering.kt PR Title: IR lowering for computing trimIndent/trimMargin on constants BEFORE CODE: private fun maybeComputeTrimIndent(call: IrCall): IrExpression { val...
I feel like this should be its own lowering phase for all platforms. Currently this phase gets IR like: ``` $receiver: STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value="\n |Hello,\n |" CONST String type=kotlin.String value="Hello,\n |World" CONST String type=...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
create( name = "kotlinAndroidPlugin", id = "org.jetbrains.kotlin.android", display = "Android" ) create( name = "kotlinAndroidExtensionsPlugin", id = "org.jetbrains.kotlin.android.extensions", display = "Kotlin Android Extensions plugin" ) create( ...
Is publishing this plugin to the plugin portal necessary?
create( name = "kotlinAndroidPlugin", id = "org.jetbrains.kotlin.android", display = "Android" ) create( name = "kotlinAndroidExtensionsPlugin", id = "org.jetbrains.kotlin.android.extensions", display = "Kotlin Android Extensions plugin" ) create( ...
@@ -210,4 +210,9 @@ pluginBundle { id = "org.jetbrains.kotlin.native.cocoapods", display = "Kotlin Native plugin for CocoaPods integration" ) + create(
libraries/tools/kotlin-gradle-plugin/build.gradle.kts
26
Kotlin
0.214
question
57
32
27
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/build.gradle.kts PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: create( name = "kotlinAndroidPlugin", id = "org.jetbrains.kotlin.android", display = "Android" ) create( ...
Is publishing this plugin to the plugin portal necessary?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Plugin import org.gradle.api.Projec...
What if tasks are executed in parallel?
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Plugin import org.gradle.api.Projec...
@@ -0,0 +1,134 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Plugin...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
26
Kotlin
0.071
question
39
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming...
What if tasks are executed in parallel?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Project import org.gradle.api.ta...
Do we really need this `@Input`s?
/* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Project import org.gradle.api.ta...
@@ -0,0 +1,29 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Project...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/PerformanceExtension.kt
15
Kotlin
0.214
question
33
29
31
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/PerformanceExtension.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: /* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming...
Do we really need this `@Input`s?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var time = 0.0 var status = true tasksNames.forEach { time += TaskTimerListener.getTime(it) status = tasksNames.map { TaskTimerListener.tasksTimes.containsKey(it) }.reduce { a, b -> a && b } status = status && success } return "${if (status) "P...
You can use `lowerCamelCaseName()` to construct a task name.
open class KotlinPerformancePlugin : Plugin<Project> { private fun checkSettings(project: Project, performanceExtension: PerformanceExtension): Boolean { var result = true if (performanceExtension.metrics.isEmpty()) { project.logger.warn("There is no tracked metrics. Please, provide metr...
@@ -0,0 +1,134 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Plugin...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
26
Kotlin
0.429
suggestion
60
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: var time = 0.0 var status = true tasks...
You can use `lowerCamelCaseName()` to construct a task name.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
status = tasksNames.map { TaskTimerListener.tasksTimes.containsKey(it) }.reduce { a, b -> a && b } status = status && success } return "${if (status) "PASSED" else "FAILED"}\nCOMPILE_TIME $time" } // Get compile task and associated with it other compile tasks. priva...
May be mention the binary in the description?
project.logger.warn("There is no tracked metrics. Please, provide metrics in settings of $EXTENSION_NAME plugin.") result = false } // Find binaries with trackable performance. if (performanceExtension.trackedBinaries.isEmpty()) { project.logger.warn("There is...
@@ -0,0 +1,134 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Plugin...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
26
Kotlin
0.071
question
45
51
50
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: status = tasksNames.map { TaskTimerListener.tasksT...
May be mention the binary in the description?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
return "${if (status) "PASSED" else "FAILED"}\nCOMPILE_TIME $time" } // Get compile task and associated with it other compile tasks. private fun getAllExecutedTasks(compilation: KotlinCompilation<*>): List<Task> { val tasks = mutableListOf(compilation.compileKotlinTask as Task) com...
`val successStatus = compileTasks.all { it.state.failure == null }`?
// Find binaries with trackable performance. if (performanceExtension.trackedBinaries.isEmpty()) { project.logger.warn("There is no tracked binaries. Please, provide binaries in settings of $EXTENSION_NAME plugin.") result = false } return result } privat...
@@ -0,0 +1,134 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Plugin...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
26
Kotlin
0.5
bug
69
51
47
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: return "${if (status) "PASSED" else "FAILED"}\nCOMPILE...
`val successStatus = compileTasks.all { it.state.failure == null }`?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Plugin import org.gradle.api.Pro...
I would avoid using static data because of Gradle daemon. It doesn't reload classes if a classpath of a build isn't change so this property may contain obsolete data.
/* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Plugin import org.gradle.api.Pro...
@@ -0,0 +1,134 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Plugin...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
20
Kotlin
0.429
suggestion
166
45
45
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: /* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programm...
I would avoid using static data because of Gradle daemon. It doesn't reload classes if a classpath of a build isn't change so this property may contain obsolete data.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
"perf${binary.buildType.toString().toLowerCase().capitalize()}" + "Report${binary.konanTarget.name.capitalize()}" ) { it.group = TASK_GROUP it.description = "Report results of performance measurement for Kotlin/Native targets." ...
I think it's better to create some subdirectory for these reports.
it.settings = performanceExtension it.timeListener = timeListener it.group = TASK_GROUP it.description = "Report performance measurement results for binary '${binary.name}' of target '${binary.target.name}'." binary.linkTask.finalizedBy(it)...
@@ -0,0 +1,134 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Plugin...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
26
Kotlin
0.286
suggestion
66
51
29
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: "perf${binary.buildType.toString().toLowerCase...
I think it's better to create some subdirectory for these reports.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Project import org.gradle.api.ta...
May be add some DSL methods allowing one to add a binary along with its name for report? Say: ``` // Or `forBinary` or some other name, it's a subject for discussion. fun binary(binary: NativeBinary, nameForReport: String = binary.name) ```
package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Project import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBinary enum class TrackableMetric { COMPILE_TIME, CODE_SIZE } open class PerformanceExtension(private val proj...
@@ -0,0 +1,29 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Project...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/PerformanceExtension.kt
26
Kotlin
0.786
suggestion
244
29
26
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/PerformanceExtension.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: /* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming...
May be add some DSL methods allowing one to add a binary along with its name for report? Say: ``` // Or `forBinary` or some other name, it's a subject for discussion. fun binary(binary: NativeBinary, nameForReport: String = binary.name) ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Plugin import org.gradle.api.Pro...
I think a property with an FQ name is safer here. A user may have his own `tasksTimes` property in the root project but he will unlikely have something like `org.jetbrains.kotlin.native.taskTimes`. Also may be replace two hashmaps with a single one? Say ```kotlin class TaskTime(val startTime: Long) { lateinit...
/* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.gradle.plugin.performance import org.gradle.api.Plugin import org.gradle.api.Pro...
@@ -9,30 +9,44 @@ import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.execution.TaskExecutionListener +import org.gradle.api.plugins.ExtraPropertiesExtension import org.gradle.api.tasks.TaskState import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension -...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
23
Kotlin
0.857
nitpick
444
48
48
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: /* * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programm...
I think a property with an FQ name is safer here. A user may have his own `tasksTimes` property in the root project but he will unlikely have something like `org.jetbrains.kotlin.native.taskTimes`. Also may be replace two hashmaps with a single one? Say ```kotlin class TaskTime(val startTime: Long) { lateinit...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (performanceExtension.metrics.isEmpty()) { project.logger.warn("There is no tracked metrics. Please, provide metrics in settings of $EXTENSION_NAME plugin.") result = false } // Find binaries with trackable performance. if (performanceExtension.trackedBinaries....
I meant a certain binary this task is created for :) Say `Report performance measurement results for binary '${binary.name}' of target '${binary.target.name}'`.
private fun checkSettings(project: Project, performanceExtension: PerformanceExtension): Boolean { var result = true if (performanceExtension.metrics.isEmpty()) { project.logger.warn("There is no tracked metrics. Please, provide metrics in settings of $EXTENSION_NAME plugin.") ...
@@ -47,67 +61,20 @@ open class KotlinPerformancePlugin : Plugin<Project> { return result } - private fun getCompilationResults(tasksNames: Iterable<String>, success: Boolean): String { - var time = 0.0 - var status = true - tasksNames.forEach { - time += TaskTimerListe...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
26
Kotlin
0.643
performance
160
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: if (performanceExtension.metrics.isEmpty()) { ...
I meant a certain binary this task is created for :) Say `Report performance measurement results for binary '${binary.name}' of target '${binary.target.name}'`.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
@Internal lateinit var settings: PerformanceExtension private fun getCompilationResults(tasksPathes: Iterable<String>, success: Boolean): String { val status = success && tasksPathes.all { timeListener.tasksTimes.containsKey(it) } val time = tasksPathes.map { timeListener.getTime(it) }.sum...
(minor) May be move this logic into the `getAllExecutedTasks` function?
@Internal lateinit var settings: PerformanceExtension private fun getCompilationResults(tasksPaths: Iterable<String>, success: Boolean): String { val status = success && tasksPaths.all { timeListener.tasksTimes.containsKey(it) } val time = tasksPaths.map { timeListener.getTime(it) }.sum() ...
@@ -0,0 +1,93 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.targets.native.tasks + +import org.gradle.api.Defau...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt
26
Kotlin
0.429
refactor
71
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: @Internal lateinit var settings: PerformanceExtension ...
(minor) May be move this logic into the `getAllExecutedTasks` function?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
lateinit var settings: PerformanceExtension private fun getCompilationResults(tasksPathes: Iterable<String>, success: Boolean): String { val status = success && tasksPathes.all { timeListener.tasksTimes.containsKey(it) } val time = tasksPathes.map { timeListener.getTime(it) }.sum() retu...
`upToDateTasks.isEmpty()` -> `upToDateTasks.isNotEmpty()`? Also may be make `upToDateTasks` a list instead of a string? And transform it to a string only when the warning is generated?
lateinit var settings: PerformanceExtension private fun getCompilationResults(tasksPaths: Iterable<String>, success: Boolean): String { val status = success && tasksPaths.all { timeListener.tasksTimes.containsKey(it) } val time = tasksPaths.map { timeListener.getTime(it) }.sum() return ...
@@ -0,0 +1,97 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.targets.native.tasks + +import org.gradle.api.Defau...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt
26
Kotlin
0.571
question
187
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: lateinit var settings: PerformanceExtension private fun...
`upToDateTasks.isEmpty()` -> `upToDateTasks.isNotEmpty()`? Also may be make `upToDateTasks` a list instead of a string? And transform it to a string only when the warning is generated?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
private fun getCompilationResults(tasksPathes: Iterable<String>, success: Boolean): String { val status = success && tasksPathes.all { timeListener.tasksTimes.containsKey(it) } val time = tasksPathes.map { timeListener.getTime(it) }.sum() return "${if (status) "PASSED" else "FAILED"}\nCOMPIL...
Not sure if we need to delete the whole report directory here.
private fun getCompilationResults(tasksPaths: Iterable<String>, success: Boolean): String { val status = success && tasksPaths.all { timeListener.tasksTimes.containsKey(it) } val time = tasksPaths.map { timeListener.getTime(it) }.sum() return "${if (status) "PASSED" else "FAILED"}\nCOMPILE_T...
@@ -0,0 +1,97 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.targets.native.tasks + +import org.gradle.api.Defau...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt
26
Kotlin
0.214
suggestion
62
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: private fun getCompilationResults(tasksPathes: Iterable<Stri...
Not sure if we need to delete the whole report directory here.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
// Get compile task and associated with it other compile tasks. private fun getAllExecutedTasks(compilation: KotlinCompilation<*>): List<Task> { val tasks = mutableListOf(compilation.compileKotlinTask as Task) compilation.associateWith.forEach { tasks += getAllExecutedTasks(it) ...
```suggestion val successStatus = allExecutedTasks.all { it.state.failure == null } ```
// Get compile task and associated with it other compile tasks. private fun getAllExecutedTasks(compilation: KotlinCompilation<*>): List<Task> { val tasks = mutableListOf(compilation.compileKotlinTask as Task) compilation.associateWith.forEach { tasks += getAllExecutedTasks(it) ...
@@ -0,0 +1,97 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.targets.native.tasks + +import org.gradle.api.Defau...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt
26
Kotlin
0.714
bug
97
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativePerformanceTask.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: // Get compile task and associated with it other compile ta...
```suggestion val successStatus = allExecutedTasks.all { it.state.failure == null } ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
import org.gradle.api.Task import org.gradle.api.execution.TaskExecutionListener import org.gradle.api.plugins.ExtraPropertiesExtension import org.gradle.api.tasks.TaskState import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension import org.jetbrains.kotlin.gradle.plugin.addExtension import org.jetbrains.kotlin.g...
```suggestion val taskTime = taskTimes.getValue(task.path) taskTime.duration = (System.nanoTime() - taskTime.startTime) / 1000.0 ```
import org.gradle.api.Task import org.gradle.api.execution.TaskExecutionListener import org.gradle.api.plugins.ExtraPropertiesExtension import org.gradle.api.tasks.TaskState import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension import org.jetbrains.kotlin.gradle.plugin.addExtension import org.jetbrains.kotlin.g...
@@ -0,0 +1,102 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.gradle.plugin.performance + +import org.gradle.api.Plugin...
libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt
26
Kotlin
0.714
suggestion
151
51
51
false
Kotlin/Native performance gradle plugin
2,713
JetBrains/kotlin
51,705
Kotlin
ilmat192
LepilkinaElena
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt PR Title: Kotlin/Native performance gradle plugin BEFORE CODE: import org.gradle.api.Task import org.gradle.api.execution.Tas...
```suggestion val taskTime = taskTimes.getValue(task.path) taskTime.duration = (System.nanoTime() - taskTime.startTime) / 1000.0 ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
fun fromString(version: String): CompilerVersion { val (major, minor, maintenance, metaString, build) = versionPattern.matchEntire(version)?.destructured ?: throw IllegalArgumentException("Cannot parse Kotlin/Native version: $version") return ...
`0` here looks strange, given that below we check for `-1`
fun fromString(version: String): CompilerVersion { val (major, minor, maintenance, milestone, metaString, build) = versionPattern.matchEntire(version)?.destructured ?: throw IllegalArgumentException("Cannot parse Kotlin/Native version: $version") ...
@@ -43,6 +45,7 @@ data class CompilerVersionImpl( override val major: Int, override val minor: Int, override val maintenance: Int, + override val milestone: Int = 0,
compiler/util-io/src/org/jetbrains/kotlin/konan/CompilerVersion.kt
26
Kotlin
0.357
suggestion
58
51
51
false
[build][native] version with milestone clause
3,126
JetBrains/kotlin
51,705
Kotlin
udalov
minamoto79
Review this pull request change. Language: Kotlin File: compiler/util-io/src/org/jetbrains/kotlin/konan/CompilerVersion.kt PR Title: [build][native] version with milestone clause BEFORE CODE: fun fromString(version: String): CompilerVersion { val (major, minor, maintenance, metaString, build) = ...
`0` here looks strange, given that below we check for `-1`
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
import org.jetbrains.kotlin.idea.caches.resolve.analyze import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall import org.jetbrains.kotlin.idea.core.NewDeclarationNameValidator import org.jetbrains.kotlin.idea.refactoring.inline.KotlinInlineValHandler import org.jetbrains.kotlin.idea.util.getLineCount import org...
I think it might be better to look for `KtBlockExpression` elements instead.
import org.jetbrains.kotlin.idea.caches.resolve.analyze import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall import org.jetbrains.kotlin.idea.core.NewDeclarationNameValidator import org.jetbrains.kotlin.idea.refactoring.inline.KotlinInlineValHandler import org.jetbrains.kotlin.idea.util.getLineCount import org...
@@ -27,22 +29,32 @@ import org.jetbrains.kotlin.idea.caches.resolve.analyze import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall import org.jetbrains.kotlin.idea.core.NewDeclarationNameValidator import org.jetbrains.kotlin.idea.refactoring.inline.KotlinInlineValHandler +import org.jetbrains.kotlin.idea.util...
idea/src/org/jetbrains/kotlin/idea/inspections/UnnecessaryVariableInspection.kt
26
Kotlin
0.429
suggestion
76
51
51
false
KT-26752 Separate "try-catch-finally" situation from the generic "Unnecessary local variable" inspection
3,359
JetBrains/kotlin
51,705
Kotlin
yanex
t-kameyama
Review this pull request change. Language: Kotlin File: idea/src/org/jetbrains/kotlin/idea/inspections/UnnecessaryVariableInspection.kt PR Title: KT-26752 Separate "try-catch-finally" situation from the generic "Unnecessary local variable" inspection BEFORE CODE: import org.jetbrains.kotlin.idea.caches.resolve.anal...
I think it might be better to look for `KtBlockExpression` elements instead.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
*/ @SinceKotlin("1.3") public expect inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrReturn( completion: Continuation<T> ): Any? /** * Starts an unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. * Returns the result of the coroutine or t...
I'd prefer if we annotated the new internal API with `@SinceKotlin("1.4")` as well, to lessen the probability of accidentally generating access to it in the backend without checking if the API version is at least 1.4.
*/ @SinceKotlin("1.3") public expect inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrReturn( completion: Continuation<T> ): Any? /** * Starts an unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. * Returns the result of the coroutine or t...
@@ -44,6 +44,13 @@ public expect inline fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedO completion: Continuation<T> ): Any? +// Internal version that support arity-2 suspending functions, might be made public in the future if needed +internal expect inline fun <R, P, T> (suspend R.(P) -> T).startCor...
libraries/stdlib/src/kotlin/coroutines/CoroutinesIntrinsicsH.kt
26
Kotlin
0.643
suggestion
217
47
51
false
stdlib: DeepRecursiveFunction
3,398
JetBrains/kotlin
51,705
Kotlin
udalov
elizarov
Review this pull request change. Language: Kotlin File: libraries/stdlib/src/kotlin/coroutines/CoroutinesIntrinsicsH.kt PR Title: stdlib: DeepRecursiveFunction BEFORE CODE: */ @SinceKotlin("1.3") public expect inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrReturn( completion: Continuation<T> ): ...
I'd prefer if we annotated the new internal API with `@SinceKotlin("1.4")` as well, to lessen the probability of accidentally generating access to it in the backend without checking if the API version is at least 1.4.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
return PsiTreeUtil.skipSiblingsForward(element, PsiWhiteSpace::class.java, PsiComment::class.java)?.startOffset ?: startOffset } return startOffset } return null } fun PsiFile.getLineEndOffset(line: Int): Int? { val document = viewProvider.document ?: PsiDocumentManager.getInst...
BTW, `getLineNumber` JavaDoc is incorrect. It accepts ints from range [0, textLength]. I fixed JavaDoc in community: https://github.com/JetBrains/intellij-community/commit/9e4198f84cdbd3f67f6a8fb94bb3f46a4e9dbb45
} return startOffset } return null } fun PsiFile.getLineEndOffset(line: Int): Int? { val document = viewProvider.document ?: PsiDocumentManager.getInstance(project).getDocument(this) return document?.getLineEndOffset(line) } fun PsiElement.getLineNumber(start: Boolean = true): Int { ...
@@ -47,18 +49,26 @@ fun PsiElement.getLineCount(): Int { if (doc != null) { val spaceRange = textRange ?: TextRange.EMPTY_RANGE - if (spaceRange.endOffset <= doc.textLength) { + if (spaceRange.endOffset <= doc.textLength && spaceRange.startOffset < spaceRange.endOffset) { val ...
idea/idea-core/src/org/jetbrains/kotlin/idea/core/util/PsiLinesUtils.kt
26
Kotlin
0.571
bug
212
47
41
false
coutLines cleanup
3,425
JetBrains/kotlin
51,705
Kotlin
nikitabobko
nikitabobko
Review this pull request change. Language: Kotlin File: idea/idea-core/src/org/jetbrains/kotlin/idea/core/util/PsiLinesUtils.kt PR Title: coutLines cleanup BEFORE CODE: return PsiTreeUtil.skipSiblingsForward(element, PsiWhiteSpace::class.java, PsiComment::class.java)?.startOffset ?: startOffset ...
BTW, `getLineNumber` JavaDoc is incorrect. It accepts ints from range [0, textLength]. I fixed JavaDoc in community: https://github.com/JetBrains/intellij-community/commit/9e4198f84cdbd3f67f6a8fb94bb3f46a4e9dbb45
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val document = viewProvider.document ?: PsiDocumentManager.getInstance(project).getDocument(this) return document?.getLineEndOffset(line) } fun PsiElement.getLineNumber(start: Boolean = true): Int { val document = containingFile.viewProvider.document ?: PsiDocumentManager.getInstance(project).getDocument(c...
Why introduce `TreeState`? The `UNSURE` value will never occur
return document?.getLineEndOffset(line) } fun PsiElement.getLineNumber(start: Boolean = true): Int { val document = containingFile.viewProvider.document ?: PsiDocumentManager.getInstance(project).getDocument(containingFile) return document?.getLineNumber(if (start) this.startOffset else this.endOffset) ?: ...
@@ -47,18 +49,26 @@ fun PsiElement.getLineCount(): Int { if (doc != null) { val spaceRange = textRange ?: TextRange.EMPTY_RANGE - if (spaceRange.endOffset <= doc.textLength) { + if (spaceRange.endOffset <= doc.textLength && spaceRange.startOffset < spaceRange.endOffset) { val ...
idea/idea-core/src/org/jetbrains/kotlin/idea/core/util/PsiLinesUtils.kt
26
Kotlin
0.357
question
62
38
32
false
coutLines cleanup
3,425
JetBrains/kotlin
51,705
Kotlin
dimonchik0036
nikitabobko
Review this pull request change. Language: Kotlin File: idea/idea-core/src/org/jetbrains/kotlin/idea/core/util/PsiLinesUtils.kt PR Title: coutLines cleanup BEFORE CODE: val document = viewProvider.document ?: PsiDocumentManager.getInstance(project).getDocument(this) return document?.getLineEndOffset(line) }...
Why introduce `TreeState`? The `UNSURE` value will never occur
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} private fun isCorrectExtension(filename: String, extensions: Set<String>): Boolean { val additionalExtensions = listOf( "after", "new", "before", "expected", "todo", "delete", "touch", "prefix", "postfix", "map", "fragment", "after2", "result", "log", "messages", "...
There might be bunches like as35
} private fun isCorrectExtension(filename: String, extensions: Set<String>): Boolean { val additionalExtensions = listOf( "after", "new", "before", "expected", "todo", "delete", "touch", "prefix", "postfix", "map", "fragment", "after2", "result", "log", "messages", "...
@@ -138,7 +138,7 @@ class CodeConformanceTest : TestCase() { for (sourceFile in FileUtil.findFilesByMask(SOURCES_BUNCH_FILE_PATTERN, root)) { if (EXCLUDED_FILES_AND_DIRS.any { FileUtil.isAncestor(it, sourceFile, false) }) continue - val matches = Regex("BUNCH: (\\w+)").findAll(sourceF...
compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt
26
Kotlin
0.071
suggestion
32
51
51
false
change "// BUNCH: xxx" format
3,439
JetBrains/kotlin
51,705
Kotlin
goodwinnk
nikitabobko
Review this pull request change. Language: Kotlin File: compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt PR Title: change "// BUNCH: xxx" format BEFORE CODE: } private fun isCorrectExtension(filename: String, extensions: Set<String>): Boolean { val additionalExtensions = listOf( ...
There might be bunches like as35
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} private fun isCorrectExtension(filename: String, extensions: Set<String>): Boolean { val additionalExtensions = listOf( "after", "new", "before", "expected", "todo", "delete", "touch", "prefix", "postfix", "map", "fragment", "after2", "result", "log", "messages", "...
Actually it can be even better: """BUNCH (\d\d\d)""". But for some reason I left older behavior
} private fun isCorrectExtension(filename: String, extensions: Set<String>): Boolean { val additionalExtensions = listOf( "after", "new", "before", "expected", "todo", "delete", "touch", "prefix", "postfix", "map", "fragment", "after2", "result", "log", "messages", "...
@@ -138,7 +138,7 @@ class CodeConformanceTest : TestCase() { for (sourceFile in FileUtil.findFilesByMask(SOURCES_BUNCH_FILE_PATTERN, root)) { if (EXCLUDED_FILES_AND_DIRS.any { FileUtil.isAncestor(it, sourceFile, false) }) continue - val matches = Regex("BUNCH (\\w+)").findAll(sourceFi...
compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt
26
Kotlin
0.286
suggestion
95
51
51
false
change "// BUNCH: xxx" format
3,439
JetBrains/kotlin
51,705
Kotlin
nikitabobko
nikitabobko
Review this pull request change. Language: Kotlin File: compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt PR Title: change "// BUNCH: xxx" format BEFORE CODE: } private fun isCorrectExtension(filename: String, extensions: Set<String>): Boolean { val additionalExtensions = listOf( ...
Actually it can be even better: """BUNCH (\d\d\d)""". But for some reason I left older behavior
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
@Suppress("UNUSED_VARIABLE") fun failWithError() { val name: String? = null assertFailsWith<IllegalStateException> { val nonNullName = name ?: error("Name is missing") } } @Sample fun failRequireWithLazyMessage() { fun getIndices(count: Int): List<Int> { requir...
Though, if you have a bit more time, could you add another variant of `requireNotNull` usage that utilizes its contract allowing to smartcast its parameter. Something like: ``` val requiredParam: String? = params["required"] requireNotNull(requiredParam) { "Required value must be non-null" } // now requiredParam is...
@Suppress("UNUSED_VARIABLE") fun failWithError() { val name: String? = null assertFailsWith<IllegalStateException> { val nonNullName = name ?: error("Name is missing") } } @Sample fun failRequireWithLazyMessage() { fun getIndices(count: Int): List<Int> { requir...
@@ -27,6 +27,22 @@ class Preconditions { assertPrints(getIndices(3), "[1, 2, 3]") } + @Sample + fun failRequireNotNullWithLazyMessage() { + + fun execWithParams(params: Map<String, String?>) { + val required = requireNotNull(params["required"]) { "Required key must be non-null" }...
libraries/stdlib/samples/test/samples/misc/preconditions.kt
26
Kotlin
1
suggestion
402
51
51
false
KT-20357: Add a sample for requireNotNull
3,584
JetBrains/kotlin
51,705
Kotlin
ilya-g
yurano
Review this pull request change. Language: Kotlin File: libraries/stdlib/samples/test/samples/misc/preconditions.kt PR Title: KT-20357: Add a sample for requireNotNull BEFORE CODE: @Suppress("UNUSED_VARIABLE") fun failWithError() { val name: String? = null assertFailsWith<IllegalStateExcept...
Though, if you have a bit more time, could you add another variant of `requireNotNull` usage that utilizes its contract allowing to smartcast its parameter. Something like: ``` val requiredParam: String? = params["required"] requireNotNull(requiredParam) { "Required value must be non-null" } // now requiredParam is...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
// Do not generate non-null checks for suspend functions. When resumed the arguments // will be null and the actual values are taken from the continuation. if (irFunction.isSuspend) return irFunction.extensionReceiverParameter?.let { generateNonNullAssertion(it) } i...
Could you explain a bit (because from my point of view all variable declarations should be inlined from original function to default one)?
if (notCallableFromJava) return // Do not generate non-null checks for suspend functions. When resumed the arguments // will be null and the actual values are taken from the continuation. if (irFunction.isSuspend) return irFunction.extensionReceiverPar...
@@ -296,7 +296,7 @@ class ExpressionCodegen( } private fun writeParameterInLocalVariableTable(startLabel: Label, endLabel: Label) { - if (irFunction.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER) return + if (!irFunction.isInline && irFunction.origin == IrDeclarationOrigin.FUNCT...
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt
26
Kotlin
0.429
question
138
51
51
false
JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769)
3,660
JetBrains/kotlin
51,705
Kotlin
max-kammerer
sfs
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt PR Title: JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769) BEFORE CODE: // Do not generate non-null checks for suspend functions....
Could you explain a bit (because from my point of view all variable declarations should be inlined from original function to default one)?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (!isCallOfFunctionInCorrespondingDefaultDispatch) return super.inlineCall(nodeAndSmap, inlineDefaultLambda, isCallOfFunctionInCorrespondingDefaultDispatch) // The call to a function in its corresponding $default handler is inlined verbatim in the JVM BE, so for compatibility // w...
Looks equivalent to just passing `MethodBodyVisitor` to `InlineAdapter`. (I don't think you need `InlineAdapter` here at all - simply overriding `visitLineNumber` to do `super.visitLineNumber(childSourceMapper.mapLineNumber(line), start)` should be enough)
context.getLocalClassType(reference) ?: throw AssertionError("callable reference ${reference.dump()} has no name in context") private val capturedParameters: Map<CapturedParamDesc, IrValueParameter> = reference.getArgumentsWithIr().associate { (param, _) -> capturedParamDesc(param.name....
@@ -194,6 +195,41 @@ class IrInlineCodegen( ::IrDefaultLambda ) } + + override fun inlineCall( + nodeAndSmap: SMAPAndMethodNode, + inlineDefaultLambda: Boolean, + isCallOfFunctionInCorrespondingDefaultDispatch: Boolean, + ): InlineResult { + if (!isCallOfFunc...
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt
26
Kotlin
0.643
suggestion
256
51
51
false
JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769)
3,660
JetBrains/kotlin
51,705
Kotlin
pyos
sfs
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt PR Title: JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769) BEFORE CODE: if (!isCallOfFunctionInCorrespondingDefaultDispatch) ...
Looks equivalent to just passing `MethodBodyVisitor` to `InlineAdapter`. (I don't think you need `InlineAdapter` here at all - simply overriding `visitLineNumber` to do `super.visitLineNumber(childSourceMapper.mapLineNumber(line), start)` should be enough)
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
irReference: IrFunctionReference, type: Type, parameter: IrValueParameter, boundReceiver: IrVariable? ): LambdaInfo { val referencedFunction = irReference.symbol.owner return IrExpressionLambdaImpl( irReference, referencedFunction, codegen.typeMapper, code...
Instead of hacking `IrInlineCodegen`, maybe create a separate implementation of `IrCallGenerator` that uses `ClassCodegen.generateMethodNode`?
return expandMaskConditionsAndUpdateVariableNodes( node, maskStartIndex, maskValues, methodHandleInDefaultMethodIndex, extractDefaultLambdaOffsetAndDescriptor(jvmSignature, function), ::IrDefaultLambda ) } } class IrExpressionLambdaImpl( val reference: IrFunc...
@@ -194,6 +195,41 @@ class IrInlineCodegen( ::IrDefaultLambda ) } + + override fun inlineCall(
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt
26
Kotlin
0.571
question
142
51
51
false
JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769)
3,660
JetBrains/kotlin
51,705
Kotlin
pyos
sfs
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt PR Title: JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769) BEFORE CODE: irReference: IrFunctionReference, type: Type, ...
Instead of hacking `IrInlineCodegen`, maybe create a separate implementation of `IrCallGenerator` that uses `ClassCodegen.generateMethodNode`?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
inlineDefaultLambda: Boolean, isCallOfFunctionInCorrespondingDefaultDispatch: Boolean, ): InlineResult { assert(delayedHiddenWriting == null) { "'putHiddenParamsIntoLocals' should be called after 'processAndPutHiddenParameters(true)'" } val node = nodeAndSmap.node if (inlineD...
That parameter was not used for anything else; in the override, you can check that using IR structures
if (inlineDefaultLambda) { for (lambda in extractDefaultLambdas(node)) { invocationParamBuilder.buildParameters().getParameterByDeclarationSlot(lambda.offset).functionalArgument = lambda val prev = expressionMap.put(lambda.offset, lambda) assert(prev =...
@@ -234,7 +238,7 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>( val inliner = MethodInliner( node, parameters, info, FieldRemapper(null, null, parameters), isSameModule, "Method inlining " + sourceCompiler.callElementText, - SourceMapCopier(sourceMapper, no...
compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt
26
Kotlin
0.429
suggestion
102
51
51
false
JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769)
3,660
JetBrains/kotlin
51,705
Kotlin
pyos
sfs
Review this pull request change. Language: Kotlin File: compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt PR Title: JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769) BEFORE CODE: inlineDefaultLambda: Boolean, isCallOfFunctionInCorrespondingDefa...
That parameter was not used for anything else; in the override, you can check that using IR structures
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
object IrInlineDefaultCodegen : IrInlineCallGenerator { override fun genValueAndPut( irValueParameter: IrValueParameter, argumentExpression: IrExpression, parameterType: Type, codegen: ExpressionCodegen, blockInfo: BlockInfo ) { // This codegen is only used for ca...
Looks like there is possible to copy all variable and remove first commit (it's not necessery to update test data in first commit in any case)
object IrInlineDefaultCodegen : IrInlineCallGenerator { override fun genValueAndPut( irValueParameter: IrValueParameter, argumentExpression: IrExpression, parameterType: Type, codegen: ExpressionCodegen, blockInfo: BlockInfo ) { // This codegen is only used for ca...
@@ -0,0 +1,55 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.backend.jvm.codegen + +import org.jetbrains.kotlin.codegen...
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineDefaultCodegen.kt
26
Kotlin
0.429
suggestion
142
34
39
false
JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769)
3,660
JetBrains/kotlin
51,705
Kotlin
max-kammerer
sfs
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineDefaultCodegen.kt PR Title: JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769) BEFORE CODE: object IrInlineDefaultCodegen : IrInlineCallGenerator { ...
Looks like there is possible to copy all variable and remove first commit (it's not necessery to update test data in first commit in any case)
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} putReifiedOperationMarkerIfTypeIsReifiedParameter(classType, ReifiedTypeInliner.OperationKind.JAVA_CLASS) } generateClassInstance(mv, classType, typeMapper) } else { throw AssertionError("not an IrGetClass or IrClassReference: ${classReferen...
Minor, but I would prefer to have more precise check here because current frontend diagnostic is too robust, but next code could become valid in some feature: ``` @Suppress("RECURSION_IN_INLINE") inline fun test(p: String = test("OK")): String { return p } fun box() : String { return test() } ``` No...
} else if (classReference is IrClassReference) { val classType = classReference.classType val classifier = classType.classifierOrNull if (classifier is IrTypeParameterSymbol) { assert(classifier.owner.isReified) { "Non-reified type paramete...
@@ -1161,11 +1163,16 @@ class ExpressionCodegen( element: IrFunctionAccessExpression, data: BlockInfo, signature: JvmMethodSignature ): IrCallGenerator { if (!element.symbol.owner.isInlineFunctionCall(context) || - classCodegen.irClass.fileParent.fileEntry is MultifileFacadeFileEntry +...
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt
26
Kotlin
1
bug
555
51
51
false
JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769)
3,660
JetBrains/kotlin
51,705
Kotlin
max-kammerer
sfs
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt PR Title: JVM IR: Generate LVT entries for parameters in inline $default methods (KT-36769) BEFORE CODE: } putReifiedOperationMarkerIfType...
Minor, but I would prefer to have more precise check here because current frontend diagnostic is too robust, but next code could become valid in some feature: ``` @Suppress("RECURSION_IN_INLINE") inline fun test(p: String = test("OK")): String { return p } fun box() : String { return test() } ``` No...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
) } }) } private fun KtValueArgument.lambdaExpression(): KtLambdaExpression? = (this as? KtLambdaArgument)?.getLambdaExpression() ?: this.getArgumentExpression() as? KtLambdaExpression private fun KtCallExpression.isDeclarationInitializer(): Boolean = KtPsiUtil.deparenthesi...
@t-kameyama would it be also possible to include the case mentioned in `testData/inspectionsLocal/redundantWith/notApplicable_inFunctionBodyWithReturn.kt`? ``` val lambdaExpression = callExpression.valueArguments.getOrNull(1)?.lambdaExpression() KtPsiUtil.skipSiblingsBackwardByPredicate(callExpression) { element -> ...
}) } private fun KtValueArgument.lambdaExpression(): KtLambdaExpression? = (this as? KtLambdaArgument)?.getLambdaExpression() ?: this.getArgumentExpression() as? KtLambdaExpression private class RemoveRedundantWithFix : LocalQuickFix { override fun getName() = KotlinBundle.message("remove.redundant.wi...
@@ -86,7 +93,13 @@ private class RemoveRedundantWithFix : LocalQuickFix { override fun applyFix(project: Project, descriptor: ProblemDescriptor) { val callExpression = descriptor.psiElement.parent as? KtCallExpression ?: return val lambdaBody = callExpression.valueArguments.getOrNull(1)?.lambdaEx...
idea/src/org/jetbrains/kotlin/idea/inspections/RedundantWithInspection.kt
26
Kotlin
1
suggestion
416
30
33
false
KT-41298 "Remove redundant 'with' call" intention works incorrectly with non-local returns and single-expression functions
3,713
JetBrains/kotlin
51,705
Kotlin
klunnii
t-kameyama
Review this pull request change. Language: Kotlin File: idea/src/org/jetbrains/kotlin/idea/inspections/RedundantWithInspection.kt PR Title: KT-41298 "Remove redundant 'with' call" intention works incorrectly with non-local returns and single-expression functions BEFORE CODE: ) } ...
@t-kameyama would it be also possible to include the case mentioned in `testData/inspectionsLocal/redundantWith/notApplicable_inFunctionBodyWithReturn.kt`? ``` val lambdaExpression = callExpression.valueArguments.getOrNull(1)?.lambdaExpression() KtPsiUtil.skipSiblingsBackwardByPredicate(callExpression) { element -> ...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
// FILE: test.kt fun box() { var x = false f(::g) } fun f(block: () -> Unit) { block() } fun g() {} // LINENUMBERS // test.kt:3 box // test.kt:4 box // test.kt:8 f // test.kt:11 g // test.kt:4 invoke // test.kt:8 f // test.kt:9 f // test.kt:5 box
@madsager Is this test affected by #3735 or not?
// FILE: test.kt fun box() { var x = false f(::g) } fun f(block: () -> Unit) { block() } fun g() {} // The synthetic invoke bridge method generated for in the callable reference has line numbers // in the JVM_IR backend (as all bridges). In the JVM backend, only some bridges have line numbers. // For som...
@@ -10,10 +10,19 @@ fun f(block: () -> Unit) { fun g() {} +// The synthetic invoke bridge method generated for in the callable reference has line numbers +// in the JVM_IR backend (as all bridges). In the JVM backend, only some bridges have line numbers. +// For some reason, when the bridge does not have line numb...
compiler/testData/debug/stepping/namedCallableReference.kt
22
Kotlin
0.071
question
48
22
31
false
[JVM_IR] Generate line numbers in synthetic bridges.
3,725
JetBrains/kotlin
51,705
Kotlin
max-kammerer
madsager
Review this pull request change. Language: Kotlin File: compiler/testData/debug/stepping/namedCallableReference.kt PR Title: [JVM_IR] Generate line numbers in synthetic bridges. BEFORE CODE: // FILE: test.kt fun box() { var x = false f(::g) } fun f(block: () -> Unit) { block() } fun g() {} // LINENU...
@madsager Is this test affected by #3735 or not?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val objectConstructor = objectConstructorCall.symbol.owner val objectConstructorBody = objectConstructor.body as? IrBlockBody ?: throw AssertionError("object literal constructor body is not a block") val newArguments = mutableListOf<IrExpression>() fun addArgument(value: IrE...
What means `null` value for `getValueArgument(i)`? Shouldn't it be getValueArgument(i)!!?
?: throw AssertionError("object literal does not end in a constructor call") val objectConstructor = objectConstructorCall.symbol.owner val objectConstructorBody = objectConstructor.body as? IrBlockBody ?: throw AssertionError("object literal constructor body is not a block") ...
@@ -78,16 +79,19 @@ private class AnonymousObjectSuperConstructorLowering(val context: JvmBackendCon ) } + fun IrExpression.transform(remapping: Map<IrVariable, IrValueParameter>): IrExpression = + when (this) { + is IrConst<*> -> this + is IrGetVa...
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AnonymousObjectSuperConstructorLowering.kt
26
Kotlin
0.571
question
89
51
51
false
JVM_IR: fix lifting of arguments to object super constructors
3,742
JetBrains/kotlin
51,705
Kotlin
max-kammerer
pyos
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AnonymousObjectSuperConstructorLowering.kt PR Title: JVM_IR: fix lifting of arguments to object super constructors BEFORE CODE: val objectConstructor = objectConstructorCall.symbol.owne...
What means `null` value for `getValueArgument(i)`? Shouldn't it be getValueArgument(i)!!?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
isInline && hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) fun IrFunction.isReifiable() = typeParameters.any { it.isReified } // Borrowed with modifications from ImplementationBodyCodegen.java private val KOTLIN_MARKER_INTERFACES: Map<FqName, String> = run { val kotlinMarkerInterfaces = mutableMapOf<FqName, S...
```suggestion val superClassType = irClass.superTypes.find { it.getClass()?.isJvmInterface == false } ```
fun IrFunction.isInlineOnly() = isInline && hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) fun IrFunction.isReifiable() = typeParameters.any { it.isReified } // Borrowed with modifications from ImplementationBodyCodegen.java private val KOTLIN_MARKER_INTERFACES: Map<FqName, String> = run { val kotlinMarkerInt...
@@ -328,42 +318,30 @@ private val KOTLIN_MARKER_INTERFACES: Map<FqName, String> = run { kotlinMarkerInterfaces } -internal class IrSuperClassInfo(val type: Type, val irType: IrType?) - -internal fun getSignature( - irClass: IrClass, - classAsmType: Type, - superClassInfo: IrSuperClassInfo, - typeMap...
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt
26
Kotlin
0.857
suggestion
111
51
51
false
JVM_IR: slightly refactor ClassCodegen
3,757
JetBrains/kotlin
51,705
Kotlin
udalov
pyos
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt PR Title: JVM_IR: slightly refactor ClassCodegen BEFORE CODE: isInline && hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) fun IrFunction.isReifiable() = typeParameters.an...
```suggestion val superClassType = irClass.superTypes.find { it.getClass()?.isJvmInterface == false } ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package samples.streams import samples.Sample import samples.assertPrints import java.util.stream.DoubleStrea...
Please use a star-import from `samples` package, this is a requirement of the runnable sample converter. For the other two packages, a star-import won't hurt either.
/* * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package samples.streams import samples.* import java.util.stream.* import kotlin.streams.* class Streams { ...
@@ -0,0 +1,82 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package samples.streams + +import samples.Sample +import samples.assertPrints
libraries/stdlib/samples/test/samples/streams/streams.kt
9
Kotlin
0.571
suggestion
166
34
34
false
Added samples for the kotlin.streams package
3,760
JetBrains/kotlin
51,705
Kotlin
ilya-g
uzilan
Review this pull request change. Language: Kotlin File: libraries/stdlib/samples/test/samples/streams/streams.kt PR Title: Added samples for the kotlin.streams package BEFORE CODE: /* * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the ...
Please use a star-import from `samples` package, this is a requirement of the runnable sample converter. For the other two packages, a star-import won't hurt either.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_NAME // TODO: Revisit this once we allow user defined equals methods in inline classes. origin = JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD returnType = irBuiltIns.booleanType ...
Maybe don't use `explicitParameters` at all now and handle dispatch/extension receivers outside of the loop (which can go only through `valueParameters`)?
name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_NAME // TODO: Revisit this once we allow user defined equals methods in inline classes. origin = JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD returnType = irBuiltIns.booleanType ...
@@ -137,18 +137,19 @@ class MemoizedInlineClassReplacements(private val mangleReturnTypes: Boolean, pr require(function.dispatchReceiverParameter != null && function is IrSimpleFunction) val newValueParameters = ArrayList<IrValueParameter>() for ((index, parameter) in function.exp...
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/inlineclasses/MemoizedInlineClassReplacements.kt
26
Kotlin
0.714
question
154
51
51
false
JVM_IR: fix copying of receivers when unboxing inline class parameters
3,764
JetBrains/kotlin
51,705
Kotlin
udalov
pyos
Review this pull request change. Language: Kotlin File: compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/inlineclasses/MemoizedInlineClassReplacements.kt PR Title: JVM_IR: fix copying of receivers when unboxing inline class parameters BEFORE CODE: name = InlineClassDescriptorResolv...
Maybe don't use `explicitParameters` at all now and handle dispatch/extension receivers outside of the loop (which can go only through `valueParameters`)?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstance<IrSimpleFunction>() val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol> get() = owner.functions.map { it.symbol } val IrClass.constructors: Sequence<IrConstructor> get() = declarations.asSequence...
This change seems like something made due to performance reasons. If so I think it good if exact list size is computed before creation to avoid extra memory allocations.
val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstance<IrSimpleFunction>() val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol> get() = owner.functions.map { it.symbol } val IrClass.constructors: Sequence<IrConstructor> get() = declarations.asSequenc...
@@ -199,8 +199,12 @@ val IrClass.primaryConstructor: IrConstructor? val IrDeclarationContainer.properties: Sequence<IrProperty> get() = declarations.asSequence().filterIsInstance<IrProperty>() -val IrFunction.explicitParameters: List<IrValueParameter> - get() = (listOfNotNull(dispatchReceiverParameter, exten...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt
26
Kotlin
0.571
performance
170
51
51
false
[IR] Avoid extra lists creation during getting explicit/all parameters
3,769
JetBrains/kotlin
51,705
Kotlin
romanart
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt PR Title: [IR] Avoid extra lists creation during getting explicit/all parameters BEFORE CODE: val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstan...
This change seems like something made due to performance reasons. If so I think it good if exact list size is computed before creation to avoid extra memory allocations.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstance<IrSimpleFunction>() val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol> get() = owner.functions.map { it.symbol } val IrClass.constructors: Sequence<IrConstructor> get() = declarations.asSequenc...
Please avoid making return type `MutableList`. Consider declaring `IrFunction.addExplicitParametersTo(MutableList)` and using it here and in `allParameters` instead.
(symbol.descriptor as CallableDescriptor).valueParameters.any { this.getValueArgument(it) == null } val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstance<IrSimpleFunction>() val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol> get() = owner.functions...
@@ -199,8 +199,12 @@ val IrClass.primaryConstructor: IrConstructor? val IrDeclarationContainer.properties: Sequence<IrProperty> get() = declarations.asSequence().filterIsInstance<IrProperty>() -val IrFunction.explicitParameters: List<IrValueParameter> - get() = (listOfNotNull(dispatchReceiverParameter, exten...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt
26
Kotlin
0.714
suggestion
166
51
51
false
[IR] Avoid extra lists creation during getting explicit/all parameters
3,769
JetBrains/kotlin
51,705
Kotlin
SvyatoslavScherbina
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt PR Title: [IR] Avoid extra lists creation during getting explicit/all parameters BEFORE CODE: val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInsta...
Please avoid making return type `MutableList`. Consider declaring `IrFunction.addExplicitParametersTo(MutableList)` and using it here and in `allParameters` instead.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstance<IrSimpleFunction>() val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol> get() = owner.functions.map { it.symbol } val IrClass.constructors: Sequence<IrConstructor> get() = declarations.asSequence...
`parametersList.addIfNotNull(dispatchReceiverParameter)`? Same below.
val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstance<IrSimpleFunction>() val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol> get() = owner.functions.map { it.symbol } val IrClass.constructors: Sequence<IrConstructor> get() = declarations.asSequenc...
@@ -199,8 +199,16 @@ val IrClass.primaryConstructor: IrConstructor? val IrDeclarationContainer.properties: Sequence<IrProperty> get() = declarations.asSequence().filterIsInstance<IrProperty>() +fun IrFunction.addExplicitParametersTo(parametersList: MutableList<IrValueParameter>) { + dispatchReceiverParameter...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt
26
Kotlin
0.5
suggestion
70
51
51
false
[IR] Avoid extra lists creation during getting explicit/all parameters
3,769
JetBrains/kotlin
51,705
Kotlin
SvyatoslavScherbina
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt PR Title: [IR] Avoid extra lists creation during getting explicit/all parameters BEFORE CODE: val IrClass.functions: Sequence<IrSimpleFunction> get() = declarations.asSequence().filterIsInstan...
`parametersList.addIfNotNull(dispatchReceiverParameter)`? Same below.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
get() = declarations.asSequence().filterIsInstance<IrConstructor>() val IrClassSymbol.constructors: Sequence<IrConstructorSymbol> get() = owner.constructors.map { it.symbol } val IrClass.fields: Sequence<IrField> get() = declarations.asSequence().filterIsInstance<IrField>() val IrClassSymbol.fields: Sequ...
Maybe `explicitParametersCount`? Same for `allParametersNumber`.
get() = declarations.asSequence().filterIsInstance<IrConstructor>() val IrClassSymbol.constructors: Sequence<IrConstructorSymbol> get() = owner.constructors.map { it.symbol } val IrClass.fields: Sequence<IrField> get() = declarations.asSequence().filterIsInstance<IrField>() val IrClassSymbol.fields: Sequ...
@@ -199,8 +200,22 @@ val IrClass.primaryConstructor: IrConstructor? val IrDeclarationContainer.properties: Sequence<IrProperty> get() = declarations.asSequence().filterIsInstance<IrProperty>() +fun IrFunction.addExplicitParametersTo(parametersList: MutableList<IrValueParameter>) { + parametersList.addIfNotNu...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt
26
Kotlin
0.357
suggestion
64
51
51
false
[IR] Avoid extra lists creation during getting explicit/all parameters
3,769
JetBrains/kotlin
51,705
Kotlin
SvyatoslavScherbina
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt PR Title: [IR] Avoid extra lists creation during getting explicit/all parameters BEFORE CODE: get() = declarations.asSequence().filterIsInstance<IrConstructor>() val IrClassSymbol.constructor...
Maybe `explicitParametersCount`? Same for `allParametersNumber`.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val IrClass.fields: Sequence<IrField> get() = declarations.asSequence().filterIsInstance<IrField>() val IrClassSymbol.fields: Sequence<IrFieldSymbol> get() = owner.fields.map { it.symbol } val IrClass.primaryConstructor: IrConstructor? get() = this.declarations.singleOrNull { it is IrConstructor && it.isP...
(Not sure if it makes sense but) now it is easy to use exact size here. Same for `allParameters`.
val IrClass.fields: Sequence<IrField> get() = declarations.asSequence().filterIsInstance<IrField>() val IrClassSymbol.fields: Sequence<IrFieldSymbol> get() = owner.fields.map { it.symbol } val IrClass.primaryConstructor: IrConstructor? get() = this.declarations.singleOrNull { it is IrConstructor && it.isP...
@@ -199,8 +200,22 @@ val IrClass.primaryConstructor: IrConstructor? val IrDeclarationContainer.properties: Sequence<IrProperty> get() = declarations.asSequence().filterIsInstance<IrProperty>() +fun IrFunction.addExplicitParametersTo(parametersList: MutableList<IrValueParameter>) { + parametersList.addIfNotNu...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt
26
Kotlin
0.429
suggestion
97
51
51
false
[IR] Avoid extra lists creation during getting explicit/all parameters
3,769
JetBrains/kotlin
51,705
Kotlin
SvyatoslavScherbina
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IrUtils.kt PR Title: [IR] Avoid extra lists creation during getting explicit/all parameters BEFORE CODE: val IrClass.fields: Sequence<IrField> get() = declarations.asSequence().filterIsInstance<IrField>(...
(Not sure if it makes sense but) now it is easy to use exact size here. Same for `allParameters`.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
thisReceiver = buildReceiverParameter(this, IrDeclarationOrigin.INSTANCE_RECEIVER, symbol.typeWithParameters(typeParameters)) } fun IrFunction.createDispatchReceiverParameter(origin: IrDeclarationOrigin? = null) { assert(dispatchReceiverParameter == null) val newDescriptor = WrappedReceiverParameterDescri...
```suggestion ArrayList<IrValueParameter>(allParametersCount).also { ```
thisReceiver = buildReceiverParameter(this, IrDeclarationOrigin.INSTANCE_RECEIVER, symbol.typeWithParameters(typeParameters)) } fun IrFunction.createDispatchReceiverParameter(origin: IrDeclarationOrigin? = null) { assert(dispatchReceiverParameter == null) val newDescriptor = WrappedReceiverParameterDescri...
@@ -432,14 +431,20 @@ fun IrFunction.createDispatchReceiverParameter(origin: IrDeclarationOrigin? = nu val IrFunction.allParameters: List<IrValueParameter> get() = if (this is IrConstructor) { - listOf( - this.constructedClass.thisReceiver - ?: error(this.render()) - ) + ...
compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt
26
Kotlin
0.571
suggestion
82
51
51
false
[IR] Avoid extra lists creation during getting explicit/all parameters
3,769
JetBrains/kotlin
51,705
Kotlin
SvyatoslavScherbina
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt PR Title: [IR] Avoid extra lists creation during getting explicit/all parameters BEFORE CODE: thisReceiver = buildReceiverParameter(this, IrDeclarationOrigin.INSTANCE_RECEIVER...
```suggestion ArrayList<IrValueParameter>(allParametersCount).also { ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val IrValueParameter.isVararg get() = this.varargElementType != null val IrFunction.isSuspend get() = this is IrSimpleFunction && this.isSuspend val IrFunction.isReal get() = !(this is IrSimpleFunction && isFakeOverride) fun IrSimpleFunction.overrides(other: IrSimpleFunction): Boolean { if (this == other) retur...
This function doesn't seem `tailrec` to me
val IrValueParameter.isVararg get() = this.varargElementType != null val IrFunction.isSuspend get() = this is IrSimpleFunction && this.isSuspend val IrFunction.isReal get() = !(this is IrSimpleFunction && isFakeOverride) fun IrSimpleFunction.overrides(other: IrSimpleFunction): Boolean { if (this == other) retur...
@@ -85,11 +85,21 @@ fun IrSimpleFunction.overrides(other: IrSimpleFunction): Boolean { private val IrConstructorCall.annotationClass get() = this.symbol.owner.constructedClass +val IrClass.packageFqName + get() = parent.getPackageFragment()?.fqName + +tailrec fun IrDeclarationWithName.hasEqualFqName(fqName: ...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/AdditionalIrUtils.kt
26
Kotlin
0.214
suggestion
42
51
51
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/AdditionalIrUtils.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: val IrValueParameter.isVararg get() = this.varargElementType != null val IrFunction.isSuspend get() = this is Ir...
This function doesn't seem `tailrec` to me
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} private val SPECIAL_INIT_NAME = Name.special("<init>") val IrValueParameter.isVararg get() = this.varargElementType != null val IrFunction.isSuspend get() = this is IrSimpleFunction && this.isSuspend val IrFunction.isReal get() = !(this is IrSimpleFunction && isFakeOverride) fun IrSimpleFunction.overrides(ot...
Maybe use explicit return type? Otherwise one needs to check the implementation to see if it's FqName or String
} private val SPECIAL_INIT_NAME = Name.special("<init>") val IrValueParameter.isVararg get() = this.varargElementType != null val IrFunction.isSuspend get() = this is IrSimpleFunction && this.isSuspend val IrFunction.isReal get() = !(this is IrSimpleFunction && isFakeOverride) fun IrSimpleFunction.overrides(ot...
@@ -85,11 +85,21 @@ fun IrSimpleFunction.overrides(other: IrSimpleFunction): Boolean { private val IrConstructorCall.annotationClass get() = this.symbol.owner.constructedClass +val IrClass.packageFqName
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/AdditionalIrUtils.kt
26
Kotlin
0.571
suggestion
111
51
51
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/AdditionalIrUtils.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: } private val SPECIAL_INIT_NAME = Name.special("<init>") val IrValueParameter.isVararg get() = this.varargEl...
Maybe use explicit return type? Otherwise one needs to check the implementation to see if it's FqName or String
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
markSuspendLambdas(irFile) buildCoroutines(irFile) transformCallableReferencesToSuspendLambdas(irFile) } private fun buildCoroutines(irFile: IrFile) { irFile.transformDeclarationsFlat(::tryTransformSuspendFunction) irFile.acceptVoid(object : IrElementVisitorVoid { ...
```suggestion name.asString() == "returnIfSuspended" ```
markSuspendLambdas(irFile) buildCoroutines(irFile) transformCallableReferencesToSuspendLambdas(irFile) } private fun buildCoroutines(irFile: IrFile) { irFile.transformDeclarationsFlat(::tryTransformSuspendFunction) irFile.acceptVoid(object : IrElementVisitorVoid { ...
@@ -80,7 +80,10 @@ abstract class AbstractSuspendFunctionsLowering<C : CommonBackendContext>(val co // Suppress since it is used in native @Suppress("MemberVisibilityCanBePrivate") protected fun IrCall.isReturnIfSuspendedCall() = - symbol.owner.run { fqNameWhenAvailable == context.internalPackageF...
compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt
26
Kotlin
0.571
suggestion
78
51
51
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: markSuspendLambdas(irFile) buildCoroutines(irFile) tran...
```suggestion name.asString() == "returnIfSuspended" ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
markSuspendLambdas(irFile) buildCoroutines(irFile) transformCallableReferencesToSuspendLambdas(irFile) } private fun buildCoroutines(irFile: IrFile) { irFile.transformDeclarationsFlat(::tryTransformSuspendFunction) irFile.acceptVoid(object : IrElementVisitorVoid { ...
Looks like the simple name check can come first now, since it's cheaper
markSuspendLambdas(irFile) buildCoroutines(irFile) transformCallableReferencesToSuspendLambdas(irFile) } private fun buildCoroutines(irFile: IrFile) { irFile.transformDeclarationsFlat(::tryTransformSuspendFunction) irFile.acceptVoid(object : IrElementVisitorVoid { ...
@@ -80,7 +80,10 @@ abstract class AbstractSuspendFunctionsLowering<C : CommonBackendContext>(val co // Suppress since it is used in native @Suppress("MemberVisibilityCanBePrivate") protected fun IrCall.isReturnIfSuspendedCall() = - symbol.owner.run { fqNameWhenAvailable == context.internalPackageF...
compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt
26
Kotlin
0.214
suggestion
71
51
51
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: markSuspendLambdas(irFile) buildCoroutines(irFile) tran...
Looks like the simple name check can come first now, since it's cheaper
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
assert(id == null) // package signature return this } val nameSegments = nameSegments if (nameSegments.size == 1) return this return PublicSignature(packageFqName, nameSegments.first(), null, adaptMask(mask)) } ...
Why do we need this function? Why doesn't normal `equals` work?
assert(id == null) // package signature return this } val nameSegments = nameSegments if (nameSegments.size == 1) return this return PublicSignature(packageFqName, nameSegments.first(), null, adaptMask(mask)) } ...
@@ -88,6 +88,9 @@ sealed class IdSignature { other is PublicSignature && packageFqName == other.packageFqName && declarationFqName == other.declarationFqName && id == other.id && mask == other.mask + fun equalsWithNames(other: Any?): Boolean =
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IdSignature.kt
26
Kotlin
0.357
question
63
51
51
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IdSignature.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: assert(id == null) // package signature return this } ...
Why do we need this function? Why doesn't normal `equals` work?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
override fun lower(irFile: IrFile) { markSuspendLambdas(irFile) buildCoroutines(irFile) transformCallableReferencesToSuspendLambdas(irFile) } private fun buildCoroutines(irFile: IrFile) { irFile.transformDeclarationsFlat(::tryTransformSuspendFunction) irFile.acceptV...
Sorry, I didn't notice the first time that there's already `returnIfSuspended` in `Symbols`. Maybe do something like this instead then: `context.ir.symbols.returnIfSuspended.signature == symbol.signature`?
override fun lower(irFile: IrFile) { markSuspendLambdas(irFile) buildCoroutines(irFile) transformCallableReferencesToSuspendLambdas(irFile) } private fun buildCoroutines(irFile: IrFile) { irFile.transformDeclarationsFlat(::tryTransformSuspendFunction) irFile.acceptV...
@@ -80,9 +80,10 @@ abstract class AbstractSuspendFunctionsLowering<C : CommonBackendContext>(val co // Suppress since it is used in native @Suppress("MemberVisibilityCanBePrivate") protected fun IrCall.isReturnIfSuspendedCall() = - symbol.owner.run { fqNameWhenAvailable == context.internalPackageF...
compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt
26
Kotlin
0.643
question
205
51
51
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: override fun lower(irFile: IrFile) { markSuspendLambdas(irFile) ...
Sorry, I didn't notice the first time that there's already `returnIfSuspended` in `Symbols`. Maybe do something like this instead then: `context.ir.symbols.returnIfSuspended.signature == symbol.signature`?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/* * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.ir.types import org.jetbrains.kotlin.builtins.PrimitiveType import org.jetbrains...
Please add `@Suppress("ObjectPropertyName")`
/* * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.ir.types import org.jetbrains.kotlin.builtins.PrimitiveType import org.jetbrains...
@@ -5,20 +5,59 @@ package org.jetbrains.kotlin.ir.types +import org.jetbrains.kotlin.builtins.PrimitiveType import org.jetbrains.kotlin.builtins.StandardNames import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrClassi...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypePredicates.kt
22
Kotlin
0.214
suggestion
44
47
47
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypePredicates.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: /* * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source cod...
Please add `@Suppress("ObjectPropertyName")`
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
private val primitiveArrayTypesSignatures: Map<PrimitiveType, IdSignature.PublicSignature> = newHashMapWithExpectedSize<PrimitiveType, IdSignature.PublicSignature>(PrimitiveType.values().size).apply { for (primitiveType in PrimitiveType.values()) { this[primitiveType] = getPubli...
This is optional and can be fixed separately, but maybe do something like this to avoid traversing the map? ``` classOrNull?.takeIf(IrClassSymbol::isPublicApi)?.signature in idSignatureToPrimitiveType ``` (but also handle nullability)
} val primitiveArrayTypesSignatures: Map<PrimitiveType, IdSignature.PublicSignature> = newHashMapWithExpectedSize<PrimitiveType, IdSignature.PublicSignature>(PrimitiveType.values().size).apply { for (primitiveType in PrimitiveType.values()) { this[primitiveType] = getPublicS...
@@ -29,55 +68,79 @@ private fun classFqNameEquals(symbol: IrClassSymbol, fqName: FqNameUnsafe): Bool return classFqNameEquals(symbol.owner, fqName) } +private val idSignatureToPrimitiveType: Map<IdSignature.PublicSignature, PrimitiveType> = + newHashMapWithExpectedSize<IdSignature.PublicSignature, PrimitiveT...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypePredicates.kt
26
Kotlin
1
suggestion
238
51
51
false
[IR] Eliminated expensive calculating of fqNames
3,815
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypePredicates.kt PR Title: [IR] Eliminated expensive calculating of fqNames BEFORE CODE: private val primitiveArrayTypesSignatures: Map<PrimitiveType, IdSignature.PublicSignature> = newHashMapWithEx...
This is optional and can be fixed separately, but maybe do something like this to avoid traversing the map? ``` classOrNull?.takeIf(IrClassSymbol::isPublicApi)?.signature in idSignatureToPrimitiveType ``` (but also handle nullability)
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
private fun Collection<FileMapping>.toSMAP(stratumName: String, mapToFirstLine: Boolean): String = if (isEmpty()) "" else "${SMAP.STRATA_SECTION} $stratumName\n" + "${SMAP.FILE_SECTION}\n${mapIndexed { id, file -> file.toSMAPFile(id + 1) }.joinToString("")}" + "${SMAP.LINE_SE...
@pyos I think you looked into source maps. I need to force the use of line number 1 for a multifile facade which has no source mappings (as it doesn't exist in the source). Do you see any bad consequences of just letting the line number get through here instead of returning -1? I could map the line number using a fake ...
private fun Collection<FileMapping>.toSMAP(stratumName: String, mapToFirstLine: Boolean): String = if (isEmpty()) "" else "${SMAP.STRATA_SECTION} $stratumName\n" + "${SMAP.FILE_SECTION}\n${mapIndexed { id, file -> file.toSMAPFile(id + 1) }.joinToString("")}" + "${SMAP.LINE_SE...
@@ -66,7 +66,7 @@ class SourceMapCopier(val parent: SourceMapper, private val smap: SMAP, val call return mappedLineNumber } - val range = lastVisitedRange?.takeIf { lineNumber in it } ?: smap.findRange(lineNumber) ?: return -1 + val range = lastVisitedRange?.takeIf { lineNumber in...
compiler/backend/src/org/jetbrains/kotlin/codegen/inline/SMAP.kt
26
Kotlin
0.5
suggestion
451
51
51
false
[JVM_IR] Use line number 1 for multifile bridge methods.
3,844
JetBrains/kotlin
51,705
Kotlin
madsager
madsager
Review this pull request change. Language: Kotlin File: compiler/backend/src/org/jetbrains/kotlin/codegen/inline/SMAP.kt PR Title: [JVM_IR] Use line number 1 for multifile bridge methods. BEFORE CODE: private fun Collection<FileMapping>.toSMAP(stratumName: String, mapToFirstLine: Boolean): String = if (isEmpty(...
@pyos I think you looked into source maps. I need to force the use of line number 1 for a multifile facade which has no source mappings (as it doesn't exist in the source). Do you see any bad consequences of just letting the line number get through here instead of returning -1? I could map the line number using a fake ...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
@JvmField val uByte = getPublicSignature(StandardNames.BUILT_INS_PACKAGE_FQ_NAME,"UByte") @JvmField val uShort = getPublicSignature(StandardNames.BUILT_INS_PACKAGE_FQ_NAME,"UShort") @JvmField val uInt = getPublicSignature(StandardNames.BUILT_INS_PACKAGE_FQ_NAME,"UInt") @JvmField val uLong = getPublicSig...
```suggestion return signature == classifier.signature ```
@JvmField val uByte = getPublicSignature(StandardNames.BUILT_INS_PACKAGE_FQ_NAME,"UByte") @JvmField val uShort = getPublicSignature(StandardNames.BUILT_INS_PACKAGE_FQ_NAME,"UShort") @JvmField val uInt = getPublicSignature(StandardNames.BUILT_INS_PACKAGE_FQ_NAME,"UInt") @JvmField val uLong = getPublicSig...
@@ -57,8 +57,7 @@ fun getPublicSignature(packageFqName: FqName, name: String) = private fun IrType.isClassType(signature: IdSignature.PublicSignature, hasQuestionMark: Boolean? = null): Boolean { if (this !is IrSimpleType) return false if (hasQuestionMark != null && this.hasQuestionMark != hasQuestionMark) r...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypePredicates.kt
26
Kotlin
0.571
suggestion
64
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/irTypePredicates.kt PR Title: [IR] Made signature nullable BEFORE CODE: @JvmField val uByte = getPublicSignature(StandardNames.BUILT_INS_PACKAGE_FQ_NAME,"UByte") @JvmField val uShort = getPublicSign...
```suggestion return signature == classifier.signature ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
import org.jetbrains.kotlin.ir.declarations.IrSymbolOwner import org.jetbrains.kotlin.ir.descriptors.IrAbstractFunctionFactory import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.descriptors.WrappedDeclarationDescriptor import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotli...
Here and below, please extract `symbol.signature` to a variable. Also, replace `assert`s with `require` here, to make use of smart casts to avoid extra `!!`
import org.jetbrains.kotlin.ir.declarations.IrSymbolOwner import org.jetbrains.kotlin.ir.descriptors.IrAbstractFunctionFactory import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.descriptors.WrappedDeclarationDescriptor import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotli...
@@ -37,9 +37,9 @@ abstract class IrModuleDeserializer(val moduleDescriptor: ModuleDescriptor) { abstract fun deserializeIrSymbol(idSig: IdSignature, symbolKind: BinarySymbolData.SymbolKind): IrSymbol open fun declareIrSymbol(symbol: IrSymbol) { - assert(symbol.isPublicApi) { "Symbol is not public API...
compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrModuleDeserializer.kt
26
Kotlin
0.714
refactor
157
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrModuleDeserializer.kt PR Title: [IR] Made signature nullable BEFORE CODE: import org.jetbrains.kotlin.ir.declarations.IrSymbolOwner import org.jetbrains.kotlin.ir.descript...
Here and below, please extract `symbol.signature` to a variable. Also, replace `assert`s with `require` here, to make use of smart casts to avoid extra `!!`
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
override fun TypeParameterMarker.getRepresentativeUpperBound(): KotlinTypeMarker = (this as IrTypeParameterSymbol).owner.superTypes.firstOrNull { val irClass = it.classOrNull?.owner ?: return@firstOrNull false irClass.kind != ClassKind.INTERFACE && irClass.kind != ClassKind.ANNOTATI...
The call to `isPublicApi` above is no longer needed here and in `getPrimitiveArrayType`
override fun TypeParameterMarker.getRepresentativeUpperBound(): KotlinTypeMarker = (this as IrTypeParameterSymbol).owner.superTypes.firstOrNull { val irClass = it.classOrNull?.owner ?: return@firstOrNull false irClass.kind != ClassKind.INTERFACE && irClass.kind != ClassKind.ANNOTATI...
@@ -347,7 +347,7 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon override fun TypeConstructorMarker.getPrimitiveType(): PrimitiveType? { if (this !is IrClassSymbol || !isPublicApi) return null - val signature = signature.asPublic() + val signature = sign...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt
26
Kotlin
0.5
suggestion
87
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt PR Title: [IR] Made signature nullable BEFORE CODE: override fun TypeParameterMarker.getRepresentativeUpperBound(): KotlinTypeMarker = (this as IrTypeParameterSymbol).own...
The call to `isPublicApi` above is no longer needed here and in `getPrimitiveArrayType`
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValu...
Why an additional condition is required here?
} val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValu...
@@ -76,8 +76,8 @@ class DeclarationStubGenerator( if (symbol is IrFieldSymbol && (symbol.descriptor as? WrappedPropertyDescriptor)?.isBound() == true) { return generateStubBySymbol(symbol, symbol.descriptor) } - val descriptor = if (symbol.descriptor is WrappedDeclarationDescriptor...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt
26
Kotlin
0.071
question
45
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
romanart
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt PR Title: [IR] Made signature nullable BEFORE CODE: } val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, ...
Why an additional condition is required here?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
3 -> { assert(idSig is IdSignature.AccessorSignature) assert(symbolKind == BinarySymbolData.SymbolKind.FUNCTION_SYMBOL) val propertyName = fqnParts[1] val accessorName = fqnParts[2] functionClass.declarations.filterIsInstance<Ir...
Could you please fix the usage of `symbol.signature!!` with `signature`
3 -> { assert(idSig is IdSignature.AccessorSignature) assert(symbolKind == BinarySymbolData.SymbolKind.FUNCTION_SYMBOL) val propertyName = fqnParts[1] val accessorName = fqnParts[2] functionClass.declarations.filterIsInstance<Ir...
@@ -166,8 +167,9 @@ class IrModuleDeserializerWithBuiltIns( } override fun declareIrSymbol(symbol: IrSymbol) { - if (symbol.isPublicApi && checkIsFunctionInterface(symbol.signature)) - resolveFunctionalInterface(symbol.signature, symbol.kind()) + val signature = symbol.signature + ...
compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrModuleDeserializer.kt
26
Kotlin
0.429
suggestion
71
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
romanart
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrModuleDeserializer.kt PR Title: [IR] Made signature nullable BEFORE CODE: 3 -> { assert(idSig is IdSignature.AccessorSignature) ...
Could you please fix the usage of `symbol.signature!!` with `signature`
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValueGenerator...
It would good if you put `symbol.signature` into a separate variable and use it without null-assertion
val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValueGenerator...
@@ -76,8 +76,8 @@ class DeclarationStubGenerator( if (symbol is IrFieldSymbol && (symbol.descriptor as? WrappedPropertyDescriptor)?.isBound() == true) { return generateStubBySymbol(symbol, symbol.descriptor) } - val descriptor = if (symbol.descriptor is WrappedDeclarationDescriptor...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt
26
Kotlin
0.714
suggestion
102
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
romanart
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt PR Title: [IR] Made signature nullable BEFORE CODE: val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, modul...
It would good if you put `symbol.signature` into a separate variable and use it without null-assertion
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValueGenerator...
```suggestion ?: error("Symbol is not public API. Expected signature for symbol: ${symbol.descriptor}") ```
val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValueGenerator...
@@ -76,8 +76,10 @@ class DeclarationStubGenerator( if (symbol is IrFieldSymbol && (symbol.descriptor as? WrappedPropertyDescriptor)?.isBound() == true) { return generateStubBySymbol(symbol, symbol.descriptor) } - val descriptor = if (symbol.descriptor is WrappedDeclarationDescripto...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt
26
Kotlin
0.857
suggestion
121
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
udalov
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt PR Title: [IR] Made signature nullable BEFORE CODE: val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, modul...
```suggestion ?: error("Symbol is not public API. Expected signature for symbol: ${symbol.descriptor}") ```
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValueGenerator...
I mean `findDescriptorBySignature(symbol.signature ?: error("Symbol is not public API. Expected signature for symbol: ${symbol.descriptor}")`
val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, moduleDescriptor.builtIns, LazyScopedTypeParametersResolver(lazyTable), true, extensions ) private val constantValueGenerator = ConstantValueGenerator...
@@ -76,8 +76,10 @@ class DeclarationStubGenerator( if (symbol is IrFieldSymbol && (symbol.descriptor as? WrappedPropertyDescriptor)?.isBound() == true) { return generateStubBySymbol(symbol, symbol.descriptor) } + val signature = symbol.signature + ?: error("Symbol is not...
compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt
26
Kotlin
0.643
suggestion
156
51
51
false
[IR] Made signature nullable
3,860
JetBrains/kotlin
51,705
Kotlin
romanart
LepilkinaElena
Review this pull request change. Language: Kotlin File: compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt PR Title: [IR] Made signature nullable BEFORE CODE: val typeTranslator = TypeTranslator( lazyTable, languageVersionSettings, modul...
I mean `findDescriptorBySignature(symbol.signature ?: error("Symbol is not public API. Expected signature for symbol: ${symbol.descriptor}")`
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
spec.summary = 'CocoaPods test library' spec.static_framework = true spec.vendored_frameworks = "build/cocoapods/framework/${frameworkName ?: "kotlin_library"}.framework" spec.libraries = "c++" ...
Renaming this property makes the plugin incompatible with Xcode projects configured by older versions of the plugin. Could you support both property names or at least don't rename it?
|Exit code mismatch for `xcodebuild`. |stdout: |$stdOut | |stderr: |$stdErr """.trimMargin() ) } ...
@@ -1251,7 +1251,7 @@ class CocoaPodsIT : BaseGradleIT() { set -ev REPO_ROOT="${'$'}PODS_TARGET_SRCROOT" "${'$'}REPO_ROOT/../gradlew" -p "${'$'}REPO_ROOT" :kotlin-library:syncFramework \ - ...
libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/CocoaPodsIT.kt
26
Kotlin
0.429
question
183
51
51
false
kotlin.native.cocoapods.targets can be a custom list of architectures
3,861
JetBrains/kotlin
51,705
Kotlin
ilmat192
MikeKulasinski-visa
Review this pull request change. Language: Kotlin File: libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/CocoaPodsIT.kt PR Title: kotlin.native.cocoapods.targets can be a custom list of architectures BEFORE CODE: spec.summary ...
Renaming this property makes the plugin incompatible with Xcode projects configured by older versions of the plugin. Could you support both property names or at least don't rename it?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
expressionCodegen.context, property.descriptor, propertyOwnerType, ownerVar, classCodegen.state ) actualType?.type?.let { type -> StackValue.coerce(type, sti.type, this) } invokeinterface( kOutputType.internalName, CallingConventions.encode + sti.eleme...
It's better to use `descType.descriptor` here instead of hardcoded string
val propertyType = classCodegen.typeMapper.mapType(property.type) val sti = generator.getSerialTypeInfo(property, propertyType) val useSerializer = if (fromClassStartVar == null) stackValueSerializerInstanceFromSerializer(classCodegen, sti, generator) else stackValueSerializerInstanceFromClass(classCode...
@@ -109,12 +109,16 @@ fun InstructionAdapter.genKOutputMethodCall( } internal fun InstructionAdapter.buildInternalConstructorDesc( + descVar: Int, propsStartVar: Int, bitMaskBase: Int, codegen: ClassBodyCodegen, args: List<SerializableProperty> ): String { val constructorDesc = StringBu...
plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/jvm/JVMCodegenUtil.kt
26
Kotlin
0.571
suggestion
73
51
51
false
Optimize check for missing fields in deserialization
3,862
JetBrains/kotlin
51,705
Kotlin
sandwwraith
shanshin
Review this pull request change. Language: Kotlin File: plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/jvm/JVMCodegenUtil.kt PR Title: Optimize check for missing fields in deserialization BEFORE CODE: expressionCodegen.context, pro...
It's better to use `descType.descriptor` here instead of hardcoded string
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
*/ package org.jetbrains.kotlinx.serialization.compiler.backend.jvm import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotli...
Am I right that this is just a stub for future runtime version loading?
*/ package org.jetbrains.kotlinx.serialization.compiler.backend.jvm import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotli...
@@ -31,10 +31,17 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.module import org.jetbrains.kotlinx.serialization.compiler.backend.common.* import org.jetbrains.kotlinx.serialization.compiler.diagnostic.serializableAnnotationIsUseless import org.jetbrains.kotlinx.serialization.compiler.resolve.* +import org.j...
plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/jvm/SerializableCodegenImpl.kt
26
Kotlin
0.214
question
71
51
51
false
Optimize check for missing fields in deserialization
3,862
JetBrains/kotlin
51,705
Kotlin
sandwwraith
shanshin
Review this pull request change. Language: Kotlin File: plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/jvm/SerializableCodegenImpl.kt PR Title: Optimize check for missing fields in deserialization BEFORE CODE: */ package org.jetbrains.kotlinx.se...
Am I right that this is just a stub for future runtime version loading?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
package org.jetbrains.kotlinx.serialization.compiler.backend.jvm import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.js....
Better move it to file with calling conventions then (you're likely going to reuse them in ir plugin)
package org.jetbrains.kotlinx.serialization.compiler.backend.jvm import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.js....
@@ -31,10 +31,17 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.module import org.jetbrains.kotlinx.serialization.compiler.backend.common.* import org.jetbrains.kotlinx.serialization.compiler.diagnostic.serializableAnnotationIsUseless import org.jetbrains.kotlinx.serialization.compiler.resolve.* +import org.j...
plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/jvm/SerializableCodegenImpl.kt
26
Kotlin
0.429
style
101
51
51
false
Optimize check for missing fields in deserialization
3,862
JetBrains/kotlin
51,705
Kotlin
sandwwraith
shanshin
Review this pull request change. Language: Kotlin File: plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/jvm/SerializableCodegenImpl.kt PR Title: Optimize check for missing fields in deserialization BEFORE CODE: package org.jetbrains.kotlinx.seriali...
Better move it to file with calling conventions then (you're likely going to reuse them in ir plugin)
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.