mobbdev 1.0.92 → 1.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +50 -29
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -293,6 +293,7 @@ var FixQuestionInputType = /* @__PURE__ */ ((FixQuestionInputType2) => {
293
293
  var Language = /* @__PURE__ */ ((Language2) => {
294
294
  Language2["Cpp"] = "CPP";
295
295
  Language2["Csharp"] = "CSHARP";
296
+ Language2["Default"] = "DEFAULT";
296
297
  Language2["Go"] = "GO";
297
298
  Language2["Java"] = "JAVA";
298
299
  Language2["Js"] = "JS";
@@ -345,6 +346,7 @@ var Fix_State_Enum = /* @__PURE__ */ ((Fix_State_Enum2) => {
345
346
  var IssueLanguage_Enum = /* @__PURE__ */ ((IssueLanguage_Enum2) => {
346
347
  IssueLanguage_Enum2["CSharp"] = "CSharp";
347
348
  IssueLanguage_Enum2["Cpp"] = "Cpp";
349
+ IssueLanguage_Enum2["Default"] = "Default";
348
350
  IssueLanguage_Enum2["Go"] = "Go";
349
351
  IssueLanguage_Enum2["Java"] = "Java";
350
352
  IssueLanguage_Enum2["JavaScript"] = "JavaScript";
@@ -414,6 +416,8 @@ var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
414
416
  IssueType_Enum2["NonReadonlyField"] = "NON_READONLY_FIELD";
415
417
  IssueType_Enum2["NoEquivalenceMethod"] = "NO_EQUIVALENCE_METHOD";
416
418
  IssueType_Enum2["NoLimitsOrThrottling"] = "NO_LIMITS_OR_THROTTLING";
419
+ IssueType_Enum2["NoOpOverhead"] = "NO_OP_OVERHEAD";
420
+ IssueType_Enum2["NoPrintStatement"] = "NO_PRINT_STATEMENT";
417
421
  IssueType_Enum2["NoReturnInFinally"] = "NO_RETURN_IN_FINALLY";
418
422
  IssueType_Enum2["NoVar"] = "NO_VAR";
419
423
  IssueType_Enum2["NullDereference"] = "NULL_DEREFERENCE";
@@ -1474,7 +1478,9 @@ var issueTypeMap = {
1474
1478
  ["AVOID_BUILTIN_SHADOWING" /* AvoidBuiltinShadowing */]: "Avoid Builtin Shadowing",
1475
1479
  ["IMPROPER_STRING_FORMATTING" /* ImproperStringFormatting */]: "Improper String Formatting",
1476
1480
  ["TAR_SLIP" /* TarSlip */]: "Tar Slip",
1477
- ["MISSING_WHITESPACE" /* MissingWhitespace */]: "Missing Whitespace"
1481
+ ["MISSING_WHITESPACE" /* MissingWhitespace */]: "Missing Whitespace",
1482
+ ["NO_PRINT_STATEMENT" /* NoPrintStatement */]: 'Python 2 "print" Statement Is Obsolete',
1483
+ ["NO_OP_OVERHEAD" /* NoOpOverhead */]: "Expensive Arguments in Conditional Methods"
1478
1484
  };
1479
1485
  var issueTypeZ = z5.nativeEnum(IssueType_Enum);
1480
1486
  var getIssueTypeFriendlyString = (issueType) => {
@@ -1519,9 +1525,9 @@ function getParsedFalsePositiveMessage(data) {
1519
1525
  const containsTemplate = extraContext.some(
1520
1526
  (context) => fixDescription.includes(`\${${context.key}}`)
1521
1527
  );
1522
- const description = containsTemplate ? replaceKeysWithValues(fixDescription, extraContext) : fixDescription;
1528
+ const description2 = containsTemplate ? replaceKeysWithValues(fixDescription, extraContext) : fixDescription;
1523
1529
  const contextString = containsTemplate ? null : `\`\`\`${extraContext.map(({ value }) => value).join(" ")} \`\`\``;
1524
- return { description, contextString };
1530
+ return { description: description2, contextString };
1525
1531
  }
1526
1532
 
1527
1533
  // src/features/analysis/scm/shared/src/validations.ts
@@ -2209,7 +2215,9 @@ var fixDetailsData = {
2209
2215
  ["IMPROPER_STRING_FORMATTING" /* ImproperStringFormatting */]: void 0,
2210
2216
  ["WILDCARD_IMPORTS" /* WildcardImports */]: void 0,
2211
2217
  ["TAR_SLIP" /* TarSlip */]: void 0,
2212
- ["MISSING_WHITESPACE" /* MissingWhitespace */]: void 0
2218
+ ["MISSING_WHITESPACE" /* MissingWhitespace */]: void 0,
2219
+ ["NO_PRINT_STATEMENT" /* NoPrintStatement */]: void 0,
2220
+ ["NO_OP_OVERHEAD" /* NoOpOverhead */]: void 0
2213
2221
  };
2214
2222
 
2215
2223
  // src/features/analysis/scm/shared/src/commitDescriptionMarkup.ts
@@ -2235,7 +2243,7 @@ var getCommitDescription = ({
2235
2243
  irrelevantIssueWithTags
2236
2244
  }) => {
2237
2245
  const issueTypeString = getIssueTypeFriendlyString(issueType);
2238
- let description = `This change fixes a **${severity} severity** (${severityToEmoji[severity]}) **${issueTypeString}** issue reported by **${capitalizeFirstLetter(
2246
+ let description2 = `This change fixes a **${severity} severity** (${severityToEmoji[severity]}) **${issueTypeString}** issue reported by **${capitalizeFirstLetter(
2239
2247
  vendor
2240
2248
  )}**.
2241
2249
 
@@ -2243,7 +2251,7 @@ var getCommitDescription = ({
2243
2251
  const parseIssueTypeRes = z9.nativeEnum(IssueType_Enum).safeParse(issueType);
2244
2252
  if (issueType && parseIssueTypeRes.success) {
2245
2253
  if (irrelevantIssueWithTags?.[0]?.tag) {
2246
- description += `
2254
+ description2 += `
2247
2255
  > [!tip]
2248
2256
  > This issue was found to be irrelevant to your project - ${lowercaseFirstLetter(getTagTooltip(irrelevantIssueWithTags[0].tag))}.
2249
2257
  > Mobb recommends to ignore this issue, however fix is available if you think differently.
@@ -2255,7 +2263,7 @@ ${issueDescription[irrelevantIssueWithTags[0].tag]}
2255
2263
  }
2256
2264
  const staticData = fixDetailsData[parseIssueTypeRes.data];
2257
2265
  if (staticData) {
2258
- description += `## Issue description
2266
+ description2 += `## Issue description
2259
2267
  ${staticData.issueDescription}
2260
2268
 
2261
2269
  ## Fix instructions
@@ -2263,16 +2271,16 @@ ${staticData.fixInstructions}
2263
2271
  `;
2264
2272
  }
2265
2273
  }
2266
- description += `
2274
+ description2 += `
2267
2275
  ${guidances.map(({ guidance }) => `## Additional actions required
2268
2276
  ${guidance}
2269
2277
  `).join("")}
2270
2278
  `;
2271
2279
  if (fixUrl) {
2272
- description += `
2280
+ description2 += `
2273
2281
  [More info and fix customization are available in the Mobb platform](${fixUrl})`;
2274
2282
  }
2275
- return description;
2283
+ return description2;
2276
2284
  };
2277
2285
  var getCommitIssueDescription = ({
2278
2286
  vendor,
@@ -2281,12 +2289,12 @@ var getCommitIssueDescription = ({
2281
2289
  fpDescription
2282
2290
  }) => {
2283
2291
  const issueTypeString = getIssueTypeFriendlyString(issueType);
2284
- let description = `The following issues reported by ${capitalizeFirstLetter(vendor)} on this PR were found to be irrelevant to your project:
2292
+ let description2 = `The following issues reported by ${capitalizeFirstLetter(vendor)} on this PR were found to be irrelevant to your project:
2285
2293
  `;
2286
2294
  const parseIssueTypeRes = z9.nativeEnum(IssueType_Enum).safeParse(issueType);
2287
2295
  if (issueType && parseIssueTypeRes.success) {
2288
2296
  if (irrelevantIssueWithTags?.[0]?.tag) {
2289
- description = `
2297
+ description2 = `
2290
2298
  > [!tip]
2291
2299
  > The following issues reported by ${capitalizeFirstLetter(vendor)} on this PR were found to be irrelevant to your project:
2292
2300
  > ${issueTypeString} - ${lowercaseFirstLetter(getTagTooltip(irrelevantIssueWithTags[0].tag))}.
@@ -2299,12 +2307,12 @@ ${fpDescription ?? issueDescription[irrelevantIssueWithTags[0].tag]}
2299
2307
  }
2300
2308
  const staticData = fixDetailsData[parseIssueTypeRes.data];
2301
2309
  if (staticData) {
2302
- description += `## Issue description
2310
+ description2 += `## Issue description
2303
2311
  ${staticData.issueDescription}
2304
2312
  `;
2305
2313
  }
2306
2314
  }
2307
- return description;
2315
+ return description2;
2308
2316
  };
2309
2317
 
2310
2318
  // src/features/analysis/scm/shared/src/guidances.ts
@@ -3053,6 +3061,15 @@ var missingCheckAgainstNull = {
3053
3061
  }
3054
3062
  };
3055
3063
 
3064
+ // src/features/analysis/scm/shared/src/storedQuestionData/java/openRedirect.ts
3065
+ var openRedirect = {
3066
+ allowlist: {
3067
+ content: () => "Allowed domains",
3068
+ description: () => "Add a comma separated list of allowed domains (e.g. 'google.com,example.com')",
3069
+ guidance: () => ""
3070
+ }
3071
+ };
3072
+
3056
3073
  // src/features/analysis/scm/shared/src/storedQuestionData/java/overlyBroadCatch.ts
3057
3074
  var overlyBroadCatch2 = {
3058
3075
  handleRuntimeExceptions: {
@@ -3302,6 +3319,7 @@ var vulnerabilities11 = {
3302
3319
  ["LOG_FORGING" /* LogForging */]: logForging3,
3303
3320
  ["LOCALE_DEPENDENT_COMPARISON" /* LocaleDependentComparison */]: localeDependentComparison,
3304
3321
  ["MISSING_CHECK_AGAINST_NULL" /* MissingCheckAgainstNull */]: missingCheckAgainstNull,
3322
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect,
3305
3323
  ["OVERLY_BROAD_CATCH" /* OverlyBroadCatch */]: overlyBroadCatch2,
3306
3324
  ["SYSTEM_INFORMATION_LEAK" /* SystemInformationLeak */]: sysLeak2,
3307
3325
  ["USE_OF_SYSTEM_OUTPUT_STREAM" /* UseOfSystemOutputStream */]: useOfSystemOutputStream2,
@@ -3511,18 +3529,21 @@ var noLimitsOrThrottling2 = {
3511
3529
  };
3512
3530
 
3513
3531
  // src/features/analysis/scm/shared/src/storedQuestionData/js/openRedirect.ts
3514
- var openRedirect = {
3532
+ var openRedirect2 = {
3515
3533
  isExternal: {
3516
- content: () => "Does the redirect go to an external site",
3534
+ content: () => "Does the redirect go to an external site?",
3517
3535
  description: () => "",
3518
3536
  guidance: () => ""
3519
3537
  },
3520
3538
  allowlist: {
3521
3539
  content: () => "Allowed domains/paths",
3522
- description: () => "If external, provide a coma separated list of allowed domains. If internal, provide a coma seperated list of allowed paths",
3540
+ description: () => description,
3523
3541
  guidance: () => ""
3524
3542
  }
3525
3543
  };
3544
+ var description = `- *If external*, provide a coma separated list of allowed domains.
3545
+  
3546
+ - *If internal*, provide a coma seperated list of allowed paths`;
3526
3547
 
3527
3548
  // src/features/analysis/scm/shared/src/storedQuestionData/js/pt.ts
3528
3549
  var pt3 = {
@@ -3620,7 +3641,7 @@ var vulnerabilities12 = {
3620
3641
  ["INCOMPLETE_URL_SANITIZATION" /* IncompleteUrlSanitization */]: incompleteUrlSanitization,
3621
3642
  ["LOG_FORGING" /* LogForging */]: logForging4,
3622
3643
  ["XSS" /* Xss */]: xss3,
3623
- ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect,
3644
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect2,
3624
3645
  ["SYSTEM_INFORMATION_LEAK" /* SystemInformationLeak */]: sysLeak3,
3625
3646
  ["SYSTEM_INFORMATION_LEAK_EXTERNAL" /* SystemInformationLeakExternal */]: sysLeakExternal,
3626
3647
  ["IFRAME_WITHOUT_SANDBOX" /* IframeWithoutSandbox */]: iframeWithoutSandbox,
@@ -3661,7 +3682,7 @@ var logForging5 = {
3661
3682
  };
3662
3683
 
3663
3684
  // src/features/analysis/scm/shared/src/storedQuestionData/python/openRedirect.ts
3664
- var openRedirect2 = {
3685
+ var openRedirect3 = {
3665
3686
  allowed_hosts: {
3666
3687
  content: () => "Allowed domains/paths",
3667
3688
  description: () => "If external, provide a coma separated list of allowed domains. If internal, provide a coma seperated list of allowed paths",
@@ -3687,7 +3708,7 @@ var uncheckedLoopCondition3 = {
3687
3708
  var vulnerabilities13 = {
3688
3709
  ["CSRF" /* Csrf */]: csrf2,
3689
3710
  ["LOG_FORGING" /* LogForging */]: logForging5,
3690
- ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect2,
3711
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect3,
3691
3712
  ["UNCHECKED_LOOP_CONDITION" /* UncheckedLoopCondition */]: uncheckedLoopCondition3,
3692
3713
  ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: duplicatedStrings2
3693
3714
  };
@@ -4508,11 +4529,11 @@ async function adoValidateParams({
4508
4529
  console.log("adoValidateParams error", e);
4509
4530
  const error = e;
4510
4531
  const code = error.code || error.status || error.statusCode || error.response?.status || error.response?.statusCode || error.response?.code;
4511
- const description = error.description || `${e}`;
4512
- if (code === 401 || code === 403 || description.includes("401") || description.includes("403")) {
4532
+ const description2 = error.description || `${e}`;
4533
+ if (code === 401 || code === 403 || description2.includes("401") || description2.includes("403")) {
4513
4534
  throw new InvalidAccessTokenError(`invalid ADO access token`);
4514
4535
  }
4515
- if (code === 404 || description.includes("404") || description.includes("Not Found")) {
4536
+ if (code === 404 || description2.includes("404") || description2.includes("Not Found")) {
4516
4537
  throw new InvalidRepoUrlError(`invalid ADO repo URL ${url}`);
4517
4538
  }
4518
4539
  console.log("adoValidateParams error", e);
@@ -7107,11 +7128,11 @@ async function gitlabValidateParams({
7107
7128
  } catch (e) {
7108
7129
  const error = e;
7109
7130
  const code = error.code || error.status || error.statusCode || error.response?.status || error.response?.statusCode || error.response?.code;
7110
- const description = error.description || `${e}`;
7111
- if (code === 401 || code === 403 || description.includes("401") || description.includes("403")) {
7131
+ const description2 = error.description || `${e}`;
7132
+ if (code === 401 || code === 403 || description2.includes("401") || description2.includes("403")) {
7112
7133
  throw new InvalidAccessTokenError(`invalid gitlab access token`);
7113
7134
  }
7114
- if (code === 404 || description.includes("404") || description.includes("Not Found")) {
7135
+ if (code === 404 || description2.includes("404") || description2.includes("Not Found")) {
7115
7136
  throw new InvalidRepoUrlError(`invalid gitlab repo URL: ${url}`);
7116
7137
  }
7117
7138
  console.log("gitlabValidateParams error", e);
@@ -8788,10 +8809,10 @@ async function addFixCommentsForPr({
8788
8809
  const parsedFpRes = await FalsePositivePartsZ.parseAsync(
8789
8810
  fpRes?.getFalsePositive
8790
8811
  );
8791
- const { description, contextString } = getParsedFalsePositiveMessage(parsedFpRes);
8792
- fpDescription = contextString ? `${description}
8812
+ const { description: description2, contextString } = getParsedFalsePositiveMessage(parsedFpRes);
8813
+ fpDescription = contextString ? `${description2}
8793
8814
 
8794
- ${contextString}` : description;
8815
+ ${contextString}` : description2;
8795
8816
  }
8796
8817
  return vulnerabilityReportIssue.codeNodes.map(
8797
8818
  (vulnerabilityReportIssueCodeNode) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.0.92",
3
+ "version": "1.0.94",
4
4
  "description": "Automated secure code remediation tool",
5
5
  "repository": "git+https://github.com/mobb-dev/bugsy.git",
6
6
  "main": "dist/index.js",