mobbdev 1.0.91 → 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 +64 -30
  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";
@@ -408,11 +410,14 @@ var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
408
410
  IssueType_Enum2["MissingEqualsOrHashcode"] = "MISSING_EQUALS_OR_HASHCODE";
409
411
  IssueType_Enum2["MissingHstsHeader"] = "MISSING_HSTS_HEADER";
410
412
  IssueType_Enum2["MissingSslMinversion"] = "MISSING_SSL_MINVERSION";
413
+ IssueType_Enum2["MissingWhitespace"] = "MISSING_WHITESPACE";
411
414
  IssueType_Enum2["ModifiedDefaultParam"] = "MODIFIED_DEFAULT_PARAM";
412
415
  IssueType_Enum2["NonFinalPublicStaticField"] = "NON_FINAL_PUBLIC_STATIC_FIELD";
413
416
  IssueType_Enum2["NonReadonlyField"] = "NON_READONLY_FIELD";
414
417
  IssueType_Enum2["NoEquivalenceMethod"] = "NO_EQUIVALENCE_METHOD";
415
418
  IssueType_Enum2["NoLimitsOrThrottling"] = "NO_LIMITS_OR_THROTTLING";
419
+ IssueType_Enum2["NoOpOverhead"] = "NO_OP_OVERHEAD";
420
+ IssueType_Enum2["NoPrintStatement"] = "NO_PRINT_STATEMENT";
416
421
  IssueType_Enum2["NoReturnInFinally"] = "NO_RETURN_IN_FINALLY";
417
422
  IssueType_Enum2["NoVar"] = "NO_VAR";
418
423
  IssueType_Enum2["NullDereference"] = "NULL_DEREFERENCE";
@@ -1472,7 +1477,10 @@ var issueTypeMap = {
1472
1477
  ["AVOID_IDENTITY_COMPARISON_CACHED_TYPES" /* AvoidIdentityComparisonCachedTypes */]: "Avoid Identity Comparison of Cached Types",
1473
1478
  ["AVOID_BUILTIN_SHADOWING" /* AvoidBuiltinShadowing */]: "Avoid Builtin Shadowing",
1474
1479
  ["IMPROPER_STRING_FORMATTING" /* ImproperStringFormatting */]: "Improper String Formatting",
1475
- ["TAR_SLIP" /* TarSlip */]: "Tar Slip"
1480
+ ["TAR_SLIP" /* TarSlip */]: "Tar Slip",
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"
1476
1484
  };
1477
1485
  var issueTypeZ = z5.nativeEnum(IssueType_Enum);
1478
1486
  var getIssueTypeFriendlyString = (issueType) => {
@@ -1517,9 +1525,9 @@ function getParsedFalsePositiveMessage(data) {
1517
1525
  const containsTemplate = extraContext.some(
1518
1526
  (context) => fixDescription.includes(`\${${context.key}}`)
1519
1527
  );
1520
- const description = containsTemplate ? replaceKeysWithValues(fixDescription, extraContext) : fixDescription;
1528
+ const description2 = containsTemplate ? replaceKeysWithValues(fixDescription, extraContext) : fixDescription;
1521
1529
  const contextString = containsTemplate ? null : `\`\`\`${extraContext.map(({ value }) => value).join(" ")} \`\`\``;
1522
- return { description, contextString };
1530
+ return { description: description2, contextString };
1523
1531
  }
1524
1532
 
1525
1533
  // src/features/analysis/scm/shared/src/validations.ts
@@ -2206,7 +2214,10 @@ var fixDetailsData = {
2206
2214
  ["AVOID_BUILTIN_SHADOWING" /* AvoidBuiltinShadowing */]: void 0,
2207
2215
  ["IMPROPER_STRING_FORMATTING" /* ImproperStringFormatting */]: void 0,
2208
2216
  ["WILDCARD_IMPORTS" /* WildcardImports */]: void 0,
2209
- ["TAR_SLIP" /* TarSlip */]: void 0
2217
+ ["TAR_SLIP" /* TarSlip */]: void 0,
2218
+ ["MISSING_WHITESPACE" /* MissingWhitespace */]: void 0,
2219
+ ["NO_PRINT_STATEMENT" /* NoPrintStatement */]: void 0,
2220
+ ["NO_OP_OVERHEAD" /* NoOpOverhead */]: void 0
2210
2221
  };
2211
2222
 
2212
2223
  // src/features/analysis/scm/shared/src/commitDescriptionMarkup.ts
@@ -2232,7 +2243,7 @@ var getCommitDescription = ({
2232
2243
  irrelevantIssueWithTags
2233
2244
  }) => {
2234
2245
  const issueTypeString = getIssueTypeFriendlyString(issueType);
2235
- 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(
2236
2247
  vendor
2237
2248
  )}**.
2238
2249
 
@@ -2240,7 +2251,7 @@ var getCommitDescription = ({
2240
2251
  const parseIssueTypeRes = z9.nativeEnum(IssueType_Enum).safeParse(issueType);
2241
2252
  if (issueType && parseIssueTypeRes.success) {
2242
2253
  if (irrelevantIssueWithTags?.[0]?.tag) {
2243
- description += `
2254
+ description2 += `
2244
2255
  > [!tip]
2245
2256
  > This issue was found to be irrelevant to your project - ${lowercaseFirstLetter(getTagTooltip(irrelevantIssueWithTags[0].tag))}.
2246
2257
  > Mobb recommends to ignore this issue, however fix is available if you think differently.
@@ -2252,7 +2263,7 @@ ${issueDescription[irrelevantIssueWithTags[0].tag]}
2252
2263
  }
2253
2264
  const staticData = fixDetailsData[parseIssueTypeRes.data];
2254
2265
  if (staticData) {
2255
- description += `## Issue description
2266
+ description2 += `## Issue description
2256
2267
  ${staticData.issueDescription}
2257
2268
 
2258
2269
  ## Fix instructions
@@ -2260,16 +2271,16 @@ ${staticData.fixInstructions}
2260
2271
  `;
2261
2272
  }
2262
2273
  }
2263
- description += `
2274
+ description2 += `
2264
2275
  ${guidances.map(({ guidance }) => `## Additional actions required
2265
2276
  ${guidance}
2266
2277
  `).join("")}
2267
2278
  `;
2268
2279
  if (fixUrl) {
2269
- description += `
2280
+ description2 += `
2270
2281
  [More info and fix customization are available in the Mobb platform](${fixUrl})`;
2271
2282
  }
2272
- return description;
2283
+ return description2;
2273
2284
  };
2274
2285
  var getCommitIssueDescription = ({
2275
2286
  vendor,
@@ -2278,12 +2289,12 @@ var getCommitIssueDescription = ({
2278
2289
  fpDescription
2279
2290
  }) => {
2280
2291
  const issueTypeString = getIssueTypeFriendlyString(issueType);
2281
- 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:
2282
2293
  `;
2283
2294
  const parseIssueTypeRes = z9.nativeEnum(IssueType_Enum).safeParse(issueType);
2284
2295
  if (issueType && parseIssueTypeRes.success) {
2285
2296
  if (irrelevantIssueWithTags?.[0]?.tag) {
2286
- description = `
2297
+ description2 = `
2287
2298
  > [!tip]
2288
2299
  > The following issues reported by ${capitalizeFirstLetter(vendor)} on this PR were found to be irrelevant to your project:
2289
2300
  > ${issueTypeString} - ${lowercaseFirstLetter(getTagTooltip(irrelevantIssueWithTags[0].tag))}.
@@ -2296,12 +2307,12 @@ ${fpDescription ?? issueDescription[irrelevantIssueWithTags[0].tag]}
2296
2307
  }
2297
2308
  const staticData = fixDetailsData[parseIssueTypeRes.data];
2298
2309
  if (staticData) {
2299
- description += `## Issue description
2310
+ description2 += `## Issue description
2300
2311
  ${staticData.issueDescription}
2301
2312
  `;
2302
2313
  }
2303
2314
  }
2304
- return description;
2315
+ return description2;
2305
2316
  };
2306
2317
 
2307
2318
  // src/features/analysis/scm/shared/src/guidances.ts
@@ -3050,6 +3061,15 @@ var missingCheckAgainstNull = {
3050
3061
  }
3051
3062
  };
3052
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
+
3053
3073
  // src/features/analysis/scm/shared/src/storedQuestionData/java/overlyBroadCatch.ts
3054
3074
  var overlyBroadCatch2 = {
3055
3075
  handleRuntimeExceptions: {
@@ -3299,6 +3319,7 @@ var vulnerabilities11 = {
3299
3319
  ["LOG_FORGING" /* LogForging */]: logForging3,
3300
3320
  ["LOCALE_DEPENDENT_COMPARISON" /* LocaleDependentComparison */]: localeDependentComparison,
3301
3321
  ["MISSING_CHECK_AGAINST_NULL" /* MissingCheckAgainstNull */]: missingCheckAgainstNull,
3322
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect,
3302
3323
  ["OVERLY_BROAD_CATCH" /* OverlyBroadCatch */]: overlyBroadCatch2,
3303
3324
  ["SYSTEM_INFORMATION_LEAK" /* SystemInformationLeak */]: sysLeak2,
3304
3325
  ["USE_OF_SYSTEM_OUTPUT_STREAM" /* UseOfSystemOutputStream */]: useOfSystemOutputStream2,
@@ -3508,18 +3529,21 @@ var noLimitsOrThrottling2 = {
3508
3529
  };
3509
3530
 
3510
3531
  // src/features/analysis/scm/shared/src/storedQuestionData/js/openRedirect.ts
3511
- var openRedirect = {
3532
+ var openRedirect2 = {
3512
3533
  isExternal: {
3513
- content: () => "Does the redirect go to an external site",
3534
+ content: () => "Does the redirect go to an external site?",
3514
3535
  description: () => "",
3515
3536
  guidance: () => ""
3516
3537
  },
3517
3538
  allowlist: {
3518
3539
  content: () => "Allowed domains/paths",
3519
- description: () => "If external, provide a coma separated list of allowed domains. If internal, provide a coma seperated list of allowed paths",
3540
+ description: () => description,
3520
3541
  guidance: () => ""
3521
3542
  }
3522
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`;
3523
3547
 
3524
3548
  // src/features/analysis/scm/shared/src/storedQuestionData/js/pt.ts
3525
3549
  var pt3 = {
@@ -3617,7 +3641,7 @@ var vulnerabilities12 = {
3617
3641
  ["INCOMPLETE_URL_SANITIZATION" /* IncompleteUrlSanitization */]: incompleteUrlSanitization,
3618
3642
  ["LOG_FORGING" /* LogForging */]: logForging4,
3619
3643
  ["XSS" /* Xss */]: xss3,
3620
- ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect,
3644
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect2,
3621
3645
  ["SYSTEM_INFORMATION_LEAK" /* SystemInformationLeak */]: sysLeak3,
3622
3646
  ["SYSTEM_INFORMATION_LEAK_EXTERNAL" /* SystemInformationLeakExternal */]: sysLeakExternal,
3623
3647
  ["IFRAME_WITHOUT_SANDBOX" /* IframeWithoutSandbox */]: iframeWithoutSandbox,
@@ -3632,6 +3656,15 @@ var vulnerabilities12 = {
3632
3656
  };
3633
3657
  var js_default = vulnerabilities12;
3634
3658
 
3659
+ // src/features/analysis/scm/shared/src/storedQuestionData/python/duplicatedStrings.ts
3660
+ var duplicatedStrings2 = {
3661
+ constantName: {
3662
+ content: () => "New constant name",
3663
+ description: () => "",
3664
+ guidance: () => ""
3665
+ }
3666
+ };
3667
+
3635
3668
  // src/features/analysis/scm/shared/src/storedQuestionData/python/logForging.ts
3636
3669
  var logForging5 = {
3637
3670
  isHtmlDisplay: {
@@ -3649,7 +3682,7 @@ var logForging5 = {
3649
3682
  };
3650
3683
 
3651
3684
  // src/features/analysis/scm/shared/src/storedQuestionData/python/openRedirect.ts
3652
- var openRedirect2 = {
3685
+ var openRedirect3 = {
3653
3686
  allowed_hosts: {
3654
3687
  content: () => "Allowed domains/paths",
3655
3688
  description: () => "If external, provide a coma separated list of allowed domains. If internal, provide a coma seperated list of allowed paths",
@@ -3675,8 +3708,9 @@ var uncheckedLoopCondition3 = {
3675
3708
  var vulnerabilities13 = {
3676
3709
  ["CSRF" /* Csrf */]: csrf2,
3677
3710
  ["LOG_FORGING" /* LogForging */]: logForging5,
3678
- ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect2,
3679
- ["UNCHECKED_LOOP_CONDITION" /* UncheckedLoopCondition */]: uncheckedLoopCondition3
3711
+ ["OPEN_REDIRECT" /* OpenRedirect */]: openRedirect3,
3712
+ ["UNCHECKED_LOOP_CONDITION" /* UncheckedLoopCondition */]: uncheckedLoopCondition3,
3713
+ ["DUPLICATED_STRINGS" /* DuplicatedStrings */]: duplicatedStrings2
3680
3714
  };
3681
3715
  var python_default2 = vulnerabilities13;
3682
3716
 
@@ -4495,11 +4529,11 @@ async function adoValidateParams({
4495
4529
  console.log("adoValidateParams error", e);
4496
4530
  const error = e;
4497
4531
  const code = error.code || error.status || error.statusCode || error.response?.status || error.response?.statusCode || error.response?.code;
4498
- const description = error.description || `${e}`;
4499
- 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")) {
4500
4534
  throw new InvalidAccessTokenError(`invalid ADO access token`);
4501
4535
  }
4502
- if (code === 404 || description.includes("404") || description.includes("Not Found")) {
4536
+ if (code === 404 || description2.includes("404") || description2.includes("Not Found")) {
4503
4537
  throw new InvalidRepoUrlError(`invalid ADO repo URL ${url}`);
4504
4538
  }
4505
4539
  console.log("adoValidateParams error", e);
@@ -7094,11 +7128,11 @@ async function gitlabValidateParams({
7094
7128
  } catch (e) {
7095
7129
  const error = e;
7096
7130
  const code = error.code || error.status || error.statusCode || error.response?.status || error.response?.statusCode || error.response?.code;
7097
- const description = error.description || `${e}`;
7098
- 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")) {
7099
7133
  throw new InvalidAccessTokenError(`invalid gitlab access token`);
7100
7134
  }
7101
- if (code === 404 || description.includes("404") || description.includes("Not Found")) {
7135
+ if (code === 404 || description2.includes("404") || description2.includes("Not Found")) {
7102
7136
  throw new InvalidRepoUrlError(`invalid gitlab repo URL: ${url}`);
7103
7137
  }
7104
7138
  console.log("gitlabValidateParams error", e);
@@ -8775,10 +8809,10 @@ async function addFixCommentsForPr({
8775
8809
  const parsedFpRes = await FalsePositivePartsZ.parseAsync(
8776
8810
  fpRes?.getFalsePositive
8777
8811
  );
8778
- const { description, contextString } = getParsedFalsePositiveMessage(parsedFpRes);
8779
- fpDescription = contextString ? `${description}
8812
+ const { description: description2, contextString } = getParsedFalsePositiveMessage(parsedFpRes);
8813
+ fpDescription = contextString ? `${description2}
8780
8814
 
8781
- ${contextString}` : description;
8815
+ ${contextString}` : description2;
8782
8816
  }
8783
8817
  return vulnerabilityReportIssue.codeNodes.map(
8784
8818
  (vulnerabilityReportIssueCodeNode) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.0.91",
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",