mobbdev 1.0.92 → 1.0.95

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 +53 -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";
@@ -371,6 +373,7 @@ var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
371
373
  IssueType_Enum2["DefaultRightsInObjDefinition"] = "DEFAULT_RIGHTS_IN_OBJ_DEFINITION";
372
374
  IssueType_Enum2["DeprecatedFunction"] = "DEPRECATED_FUNCTION";
373
375
  IssueType_Enum2["DosStringBuilder"] = "DOS_STRING_BUILDER";
376
+ IssueType_Enum2["DoNotRaiseException"] = "DO_NOT_RAISE_EXCEPTION";
374
377
  IssueType_Enum2["DuplicatedStrings"] = "DUPLICATED_STRINGS";
375
378
  IssueType_Enum2["ErroneousStringCompare"] = "ERRONEOUS_STRING_COMPARE";
376
379
  IssueType_Enum2["ErrorCondtionWithoutAction"] = "ERROR_CONDTION_WITHOUT_ACTION";
@@ -414,6 +417,8 @@ var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
414
417
  IssueType_Enum2["NonReadonlyField"] = "NON_READONLY_FIELD";
415
418
  IssueType_Enum2["NoEquivalenceMethod"] = "NO_EQUIVALENCE_METHOD";
416
419
  IssueType_Enum2["NoLimitsOrThrottling"] = "NO_LIMITS_OR_THROTTLING";
420
+ IssueType_Enum2["NoOpOverhead"] = "NO_OP_OVERHEAD";
421
+ IssueType_Enum2["NoPrintStatement"] = "NO_PRINT_STATEMENT";
417
422
  IssueType_Enum2["NoReturnInFinally"] = "NO_RETURN_IN_FINALLY";
418
423
  IssueType_Enum2["NoVar"] = "NO_VAR";
419
424
  IssueType_Enum2["NullDereference"] = "NULL_DEREFERENCE";
@@ -1474,7 +1479,10 @@ var issueTypeMap = {
1474
1479
  ["AVOID_BUILTIN_SHADOWING" /* AvoidBuiltinShadowing */]: "Avoid Builtin Shadowing",
1475
1480
  ["IMPROPER_STRING_FORMATTING" /* ImproperStringFormatting */]: "Improper String Formatting",
1476
1481
  ["TAR_SLIP" /* TarSlip */]: "Tar Slip",
1477
- ["MISSING_WHITESPACE" /* MissingWhitespace */]: "Missing Whitespace"
1482
+ ["MISSING_WHITESPACE" /* MissingWhitespace */]: "Missing Whitespace",
1483
+ ["NO_PRINT_STATEMENT" /* NoPrintStatement */]: 'Python 2 "print" Statement Is Obsolete',
1484
+ ["NO_OP_OVERHEAD" /* NoOpOverhead */]: "Expensive Arguments in Conditional Methods",
1485
+ ["DO_NOT_RAISE_EXCEPTION" /* DoNotRaiseException */]: "Do Not Raise Exception"
1478
1486
  };
1479
1487
  var issueTypeZ = z5.nativeEnum(IssueType_Enum);
1480
1488
  var getIssueTypeFriendlyString = (issueType) => {
@@ -1519,9 +1527,9 @@ function getParsedFalsePositiveMessage(data) {
1519
1527
  const containsTemplate = extraContext.some(
1520
1528
  (context) => fixDescription.includes(`\${${context.key}}`)
1521
1529
  );
1522
- const description = containsTemplate ? replaceKeysWithValues(fixDescription, extraContext) : fixDescription;
1530
+ const description2 = containsTemplate ? replaceKeysWithValues(fixDescription, extraContext) : fixDescription;
1523
1531
  const contextString = containsTemplate ? null : `\`\`\`${extraContext.map(({ value }) => value).join(" ")} \`\`\``;
1524
- return { description, contextString };
1532
+ return { description: description2, contextString };
1525
1533
  }
1526
1534
 
1527
1535
  // src/features/analysis/scm/shared/src/validations.ts
@@ -2209,7 +2217,10 @@ var fixDetailsData = {
2209
2217
  ["IMPROPER_STRING_FORMATTING" /* ImproperStringFormatting */]: void 0,
2210
2218
  ["WILDCARD_IMPORTS" /* WildcardImports */]: void 0,
2211
2219
  ["TAR_SLIP" /* TarSlip */]: void 0,
2212
- ["MISSING_WHITESPACE" /* MissingWhitespace */]: void 0
2220
+ ["MISSING_WHITESPACE" /* MissingWhitespace */]: void 0,
2221
+ ["NO_PRINT_STATEMENT" /* NoPrintStatement */]: void 0,
2222
+ ["NO_OP_OVERHEAD" /* NoOpOverhead */]: void 0,
2223
+ ["DO_NOT_RAISE_EXCEPTION" /* DoNotRaiseException */]: void 0
2213
2224
  };
2214
2225
 
2215
2226
  // src/features/analysis/scm/shared/src/commitDescriptionMarkup.ts
@@ -2235,7 +2246,7 @@ var getCommitDescription = ({
2235
2246
  irrelevantIssueWithTags
2236
2247
  }) => {
2237
2248
  const issueTypeString = getIssueTypeFriendlyString(issueType);
2238
- let description = `This change fixes a **${severity} severity** (${severityToEmoji[severity]}) **${issueTypeString}** issue reported by **${capitalizeFirstLetter(
2249
+ let description2 = `This change fixes a **${severity} severity** (${severityToEmoji[severity]}) **${issueTypeString}** issue reported by **${capitalizeFirstLetter(
2239
2250
  vendor
2240
2251
  )}**.
2241
2252
 
@@ -2243,7 +2254,7 @@ var getCommitDescription = ({
2243
2254
  const parseIssueTypeRes = z9.nativeEnum(IssueType_Enum).safeParse(issueType);
2244
2255
  if (issueType && parseIssueTypeRes.success) {
2245
2256
  if (irrelevantIssueWithTags?.[0]?.tag) {
2246
- description += `
2257
+ description2 += `
2247
2258
  > [!tip]
2248
2259
  > This issue was found to be irrelevant to your project - ${lowercaseFirstLetter(getTagTooltip(irrelevantIssueWithTags[0].tag))}.
2249
2260
  > Mobb recommends to ignore this issue, however fix is available if you think differently.
@@ -2255,7 +2266,7 @@ ${issueDescription[irrelevantIssueWithTags[0].tag]}
2255
2266
  }
2256
2267
  const staticData = fixDetailsData[parseIssueTypeRes.data];
2257
2268
  if (staticData) {
2258
- description += `## Issue description
2269
+ description2 += `## Issue description
2259
2270
  ${staticData.issueDescription}
2260
2271
 
2261
2272
  ## Fix instructions
@@ -2263,16 +2274,16 @@ ${staticData.fixInstructions}
2263
2274
  `;
2264
2275
  }
2265
2276
  }
2266
- description += `
2277
+ description2 += `
2267
2278
  ${guidances.map(({ guidance }) => `## Additional actions required
2268
2279
  ${guidance}
2269
2280
  `).join("")}
2270
2281
  `;
2271
2282
  if (fixUrl) {
2272
- description += `
2283
+ description2 += `
2273
2284
  [More info and fix customization are available in the Mobb platform](${fixUrl})`;
2274
2285
  }
2275
- return description;
2286
+ return description2;
2276
2287
  };
2277
2288
  var getCommitIssueDescription = ({
2278
2289
  vendor,
@@ -2281,12 +2292,12 @@ var getCommitIssueDescription = ({
2281
2292
  fpDescription
2282
2293
  }) => {
2283
2294
  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:
2295
+ let description2 = `The following issues reported by ${capitalizeFirstLetter(vendor)} on this PR were found to be irrelevant to your project:
2285
2296
  `;
2286
2297
  const parseIssueTypeRes = z9.nativeEnum(IssueType_Enum).safeParse(issueType);
2287
2298
  if (issueType && parseIssueTypeRes.success) {
2288
2299
  if (irrelevantIssueWithTags?.[0]?.tag) {
2289
- description = `
2300
+ description2 = `
2290
2301
  > [!tip]
2291
2302
  > The following issues reported by ${capitalizeFirstLetter(vendor)} on this PR were found to be irrelevant to your project:
2292
2303
  > ${issueTypeString} - ${lowercaseFirstLetter(getTagTooltip(irrelevantIssueWithTags[0].tag))}.
@@ -2299,12 +2310,12 @@ ${fpDescription ?? issueDescription[irrelevantIssueWithTags[0].tag]}
2299
2310
  }
2300
2311
  const staticData = fixDetailsData[parseIssueTypeRes.data];
2301
2312
  if (staticData) {
2302
- description += `## Issue description
2313
+ description2 += `## Issue description
2303
2314
  ${staticData.issueDescription}
2304
2315
  `;
2305
2316
  }
2306
2317
  }
2307
- return description;
2318
+ return description2;
2308
2319
  };
2309
2320
 
2310
2321
  // src/features/analysis/scm/shared/src/guidances.ts
@@ -3053,6 +3064,15 @@ var missingCheckAgainstNull = {
3053
3064
  }
3054
3065
  };
3055
3066
 
3067
+ // src/features/analysis/scm/shared/src/storedQuestionData/java/openRedirect.ts
3068
+ var openRedirect = {
3069
+ allowlist: {
3070
+ content: () => "Allowed domains",
3071
+ description: () => "Add a comma separated list of allowed domains (e.g. 'google.com,example.com')",
3072
+ guidance: () => ""
3073
+ }
3074
+ };
3075
+
3056
3076
  // src/features/analysis/scm/shared/src/storedQuestionData/java/overlyBroadCatch.ts
3057
3077
  var overlyBroadCatch2 = {
3058
3078
  handleRuntimeExceptions: {
@@ -3302,6 +3322,7 @@ var vulnerabilities11 = {
3302
3322
  ["LOG_FORGING" /* LogForging */]: logForging3,
3303
3323
  ["LOCALE_DEPENDENT_COMPARISON" /* LocaleDependentComparison */]: localeDependentComparison,
3304
3324
  ["MISSING_CHECK_AGAINST_NULL" /* MissingCheckAgainstNull */]: missingCheckAgainstNull,
3325
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect,
3305
3326
  ["OVERLY_BROAD_CATCH" /* OverlyBroadCatch */]: overlyBroadCatch2,
3306
3327
  ["SYSTEM_INFORMATION_LEAK" /* SystemInformationLeak */]: sysLeak2,
3307
3328
  ["USE_OF_SYSTEM_OUTPUT_STREAM" /* UseOfSystemOutputStream */]: useOfSystemOutputStream2,
@@ -3511,18 +3532,21 @@ var noLimitsOrThrottling2 = {
3511
3532
  };
3512
3533
 
3513
3534
  // src/features/analysis/scm/shared/src/storedQuestionData/js/openRedirect.ts
3514
- var openRedirect = {
3535
+ var openRedirect2 = {
3515
3536
  isExternal: {
3516
- content: () => "Does the redirect go to an external site",
3537
+ content: () => "Does the redirect go to an external site?",
3517
3538
  description: () => "",
3518
3539
  guidance: () => ""
3519
3540
  },
3520
3541
  allowlist: {
3521
3542
  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",
3543
+ description: () => description,
3523
3544
  guidance: () => ""
3524
3545
  }
3525
3546
  };
3547
+ var description = `- *If external*, provide a coma separated list of allowed domains.
3548
+  
3549
+ - *If internal*, provide a coma seperated list of allowed paths`;
3526
3550
 
3527
3551
  // src/features/analysis/scm/shared/src/storedQuestionData/js/pt.ts
3528
3552
  var pt3 = {
@@ -3620,7 +3644,7 @@ var vulnerabilities12 = {
3620
3644
  ["INCOMPLETE_URL_SANITIZATION" /* IncompleteUrlSanitization */]: incompleteUrlSanitization,
3621
3645
  ["LOG_FORGING" /* LogForging */]: logForging4,
3622
3646
  ["XSS" /* Xss */]: xss3,
3623
- ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect,
3647
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect2,
3624
3648
  ["SYSTEM_INFORMATION_LEAK" /* SystemInformationLeak */]: sysLeak3,
3625
3649
  ["SYSTEM_INFORMATION_LEAK_EXTERNAL" /* SystemInformationLeakExternal */]: sysLeakExternal,
3626
3650
  ["IFRAME_WITHOUT_SANDBOX" /* IframeWithoutSandbox */]: iframeWithoutSandbox,
@@ -3661,7 +3685,7 @@ var logForging5 = {
3661
3685
  };
3662
3686
 
3663
3687
  // src/features/analysis/scm/shared/src/storedQuestionData/python/openRedirect.ts
3664
- var openRedirect2 = {
3688
+ var openRedirect3 = {
3665
3689
  allowed_hosts: {
3666
3690
  content: () => "Allowed domains/paths",
3667
3691
  description: () => "If external, provide a coma separated list of allowed domains. If internal, provide a coma seperated list of allowed paths",
@@ -3687,7 +3711,7 @@ var uncheckedLoopCondition3 = {
3687
3711
  var vulnerabilities13 = {
3688
3712
  ["CSRF" /* Csrf */]: csrf2,
3689
3713
  ["LOG_FORGING" /* LogForging */]: logForging5,
3690
- ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect2,
3714
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect3,
3691
3715
  ["UNCHECKED_LOOP_CONDITION" /* UncheckedLoopCondition */]: uncheckedLoopCondition3,
3692
3716
  ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: duplicatedStrings2
3693
3717
  };
@@ -4508,11 +4532,11 @@ async function adoValidateParams({
4508
4532
  console.log("adoValidateParams error", e);
4509
4533
  const error = e;
4510
4534
  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")) {
4535
+ const description2 = error.description || `${e}`;
4536
+ if (code === 401 || code === 403 || description2.includes("401") || description2.includes("403")) {
4513
4537
  throw new InvalidAccessTokenError(`invalid ADO access token`);
4514
4538
  }
4515
- if (code === 404 || description.includes("404") || description.includes("Not Found")) {
4539
+ if (code === 404 || description2.includes("404") || description2.includes("Not Found")) {
4516
4540
  throw new InvalidRepoUrlError(`invalid ADO repo URL ${url}`);
4517
4541
  }
4518
4542
  console.log("adoValidateParams error", e);
@@ -7107,11 +7131,11 @@ async function gitlabValidateParams({
7107
7131
  } catch (e) {
7108
7132
  const error = e;
7109
7133
  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")) {
7134
+ const description2 = error.description || `${e}`;
7135
+ if (code === 401 || code === 403 || description2.includes("401") || description2.includes("403")) {
7112
7136
  throw new InvalidAccessTokenError(`invalid gitlab access token`);
7113
7137
  }
7114
- if (code === 404 || description.includes("404") || description.includes("Not Found")) {
7138
+ if (code === 404 || description2.includes("404") || description2.includes("Not Found")) {
7115
7139
  throw new InvalidRepoUrlError(`invalid gitlab repo URL: ${url}`);
7116
7140
  }
7117
7141
  console.log("gitlabValidateParams error", e);
@@ -8788,10 +8812,10 @@ async function addFixCommentsForPr({
8788
8812
  const parsedFpRes = await FalsePositivePartsZ.parseAsync(
8789
8813
  fpRes?.getFalsePositive
8790
8814
  );
8791
- const { description, contextString } = getParsedFalsePositiveMessage(parsedFpRes);
8792
- fpDescription = contextString ? `${description}
8815
+ const { description: description2, contextString } = getParsedFalsePositiveMessage(parsedFpRes);
8816
+ fpDescription = contextString ? `${description2}
8793
8817
 
8794
- ${contextString}` : description;
8818
+ ${contextString}` : description2;
8795
8819
  }
8796
8820
  return vulnerabilityReportIssue.codeNodes.map(
8797
8821
  (vulnerabilityReportIssueCodeNode) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.0.92",
3
+ "version": "1.0.95",
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",