Dataset Viewer
Auto-converted to Parquet
Search is not available for this dataset
hash
string
value
dict
prompt_base
list
prompt_thinking
list
033b0baff52bb483
{ "callgraph": "[FindFiles->[Builder->[asOfTime->[inSnapshot],inPartitions->[inPartitions]]]]", "msg": "If there are no manifests, then entries should be `CloseableIterable.empty()`, not the manifest iterable. That doesn't need to be closeable.", "patch": "@@ -191,7 +191,10 @@ public class FindFiles {\n Snapshot snapshot = snapshotId != null ?\n ops.current().snapshot(snapshotId) : ops.current().currentSnapshot();\n \n- CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, snapshot.manifests())\n+ // snapshot could be null when the table just gets created\n+ Iterable<ManifestFile> manifests = (snapshot != null) ? snapshot.manifests() : CloseableIterable.empty();\n+\n+ CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, manifests)\n .filterData(rowFilter)\n .filterFiles(fileFilter)\n .filterPartitions(partitionFilter)", "summary": "Collect all data files in the manifest." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -98,7 +98,7 @@ public class IndexSpec\n Preconditions.checkArgument(metricCompression == null || COMPRESSION_NAMES.contains(metricCompression),\n \"Unknown compression type[%s]\", metricCompression);\n \n- this.bitmapSerdeFactory = bitmapSerdeFactory != null ? bitmapSerdeFactory : IndexIO.CONFIGURED_BITMAP_SERDE_FACTORY;\n+ this.bitmapSerdeFactory = bitmapSerdeFactory != null ? bitmapSerdeFactory : new ConciseBitmapSerdeFactory();\n this.metricCompression = metricCompression;\n this.dimensionCompression = dimensionCompression;\n }\n\nCallgraph: \t[IndexSpec->[hashCode->[hashCode],equals->[equals]]]\nCodereview: ", "role": "user" }, { "content": "Does this mean `druid.processing.bitmap.type` will no longer work to set the default bitmap type? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -202,6 +202,16 @@ public class CompactionTask extends AbstractBatchIndexTask\n this.dimensionsSpec = dimensionsSpec == null ? dimensions : dimensionsSpec;\n this.metricsSpec = metricsSpec;\n this.segmentGranularity = segmentGranularity;\n+ if (granularitySpec == null && segmentGranularity != null) {\n+ this.granularitySpec = new UniformGranularitySpec(\n+ segmentGranularity,\n+ null,\n+ null,\n+ null\n+ );\n+ } else {\n+ this.granularitySpec = granularitySpec;\n+ }\n this.tuningConfig = tuningConfig != null ? getTuningConfig(tuningConfig) : null;\n this.segmentProvider = new SegmentProvider(dataSource, this.ioConfig.getInputSpec());\n this.partitionConfigurationManager = new PartitionConfigurationManager(this.tuningConfig);\n\nCallgraph: \t[CompactionTask->[createContextForSubtask->[getPriority],createDimensionsSpec->[getType],Builder->[build->[CompactionTask]],runTask->[isReady]]]\nCodereview: ", "role": "user" }, { "content": "What happens if both segmentGranularity & granularitySpec are non-null? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -40,7 +40,7 @@ public class ArrayConcat {\n }\n final int leftSize = left != null ? left.size() : 0;\n final int rightSize = right != null ? right.size() : 0;\n- final List<T> result = new ArrayList(leftSize + rightSize);\n+ final List<T> result = new ArrayList<>(leftSize + rightSize);\n if (left != null) {\n result.addAll(left);\n }\n\nCallgraph: \t[ArrayConcat->[concat->[ArrayList,addAll,size]]]\nCodereview: ", "role": "user" }, { "content": "Minor side improvement to get rid or compiler warning. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -391,7 +391,9 @@ public class HoodieDeltaStreamer implements Serializable {\n ValidationUtils.checkArgument(!cfg.filterDupes || cfg.operation != Operation.UPSERT,\n \"'--filter-dupes' needs to be disabled when '--op' is 'UPSERT' to ensure updates are not missed.\");\n \n- this.props = properties != null ? properties : UtilHelpers.readConfig(fs, new Path(cfg.propsFilePath), cfg.configs).getConfig();\n+ this.props = properties != null ? properties : UtilHelpers.readConfig(\n+ FSUtils.getFs(cfg.propsFilePath, jssc.hadoopConfiguration()),\n+ new Path(cfg.propsFilePath), cfg.configs).getConfig();\n LOG.info(\"Creating delta streamer with configs : \" + props.toString());\n this.schemaProvider = UtilHelpers.createSchemaProvider(cfg.schemaProviderClassName, props, jssc);\n \n\nCallgraph: \t[HoodieDeltaStreamer->[DeltaSyncService->[startService->[isAsyncCompactionEnabled],onInitializingWriteClient->[isAsyncCompactionEnabled],close->[close]],main->[sync,Config]]]\nCodereview: ", "role": "user" }, { "content": "Let us make it flexible in HoodieMultiTableDeltaStreamer as well? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -73,7 +73,14 @@ public class ExprUtils\n } else {\n Chronology chronology = timeZone == null ? ISOChronology.getInstanceUTC() : ISOChronology.getInstance(timeZone);\n final Object value = originArg.eval(bindings).value();\n- origin = value != null ? new DateTime(value, chronology) : null;\n+ if (value instanceof String && StringUtils.isEmpty((String) value)) {\n+ // We get a blank string here, when sql compatible null handling is enabled\n+ // and expression contains empty string for for origin\n+ // e.g timestamp_floor(\\\"__time\\\",'PT1M','','UTC')\n+ origin = null;\n+ } else {\n+ origin = value != null ? new DateTime(value, chronology) : null;\n+ }\n }\n \n return new PeriodGranularity(period, origin, timeZone);\n\nCallgraph: \t[ExprUtils->[toTimeZone->[isLiteral,getLiteralValue,IAE,inferTzfromString],toPeriodGranularity->[value,inferTzfromString,getInstance,getInstanceUTC,DateTime,PeriodGranularity,asString,Period]]]\nCodereview: ", "role": "user" }, { "content": "This `StringUtils.isEmpty()` is a dangerously-named synonym of `isNullOrEmpty()`, although it won't make difference here, because of the `value instanceof String` check guaranteeing that the value is not null. Please prohibit this whole `org.apache.commons.lang.StringUtils` class on forbidden-apis level. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -191,7 +191,10 @@ public class FindFiles {\n Snapshot snapshot = snapshotId != null ?\n ops.current().snapshot(snapshotId) : ops.current().currentSnapshot();\n \n- CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, snapshot.manifests())\n+ // snapshot could be null when the table just gets created\n+ Iterable<ManifestFile> manifests = (snapshot != null) ? snapshot.manifests() : CloseableIterable.empty();\n+\n+ CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, manifests)\n .filterData(rowFilter)\n .filterFiles(fileFilter)\n .filterPartitions(partitionFilter)\nCallgraph: \t[FindFiles->[Builder->[asOfTime->[inSnapshot],inPartitions->[inPartitions]]]]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -98,7 +98,7 @@ public class IndexSpec\n Preconditions.checkArgument(metricCompression == null || COMPRESSION_NAMES.contains(metricCompression),\n \"Unknown compression type[%s]\", metricCompression);\n \n- this.bitmapSerdeFactory = bitmapSerdeFactory != null ? bitmapSerdeFactory : IndexIO.CONFIGURED_BITMAP_SERDE_FACTORY;\n+ this.bitmapSerdeFactory = bitmapSerdeFactory != null ? bitmapSerdeFactory : new ConciseBitmapSerdeFactory();\n this.metricCompression = metricCompression;\n this.dimensionCompression = dimensionCompression;\n }\n\nCallgraph: \t[IndexSpec->[hashCode->[hashCode],equals->[equals]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nDoes this mean `druid.processing.bitmap.type` will no longer work to set the default bitmap type? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -202,6 +202,16 @@ public class CompactionTask extends AbstractBatchIndexTask\n this.dimensionsSpec = dimensionsSpec == null ? dimensions : dimensionsSpec;\n this.metricsSpec = metricsSpec;\n this.segmentGranularity = segmentGranularity;\n+ if (granularitySpec == null && segmentGranularity != null) {\n+ this.granularitySpec = new UniformGranularitySpec(\n+ segmentGranularity,\n+ null,\n+ null,\n+ null\n+ );\n+ } else {\n+ this.granularitySpec = granularitySpec;\n+ }\n this.tuningConfig = tuningConfig != null ? getTuningConfig(tuningConfig) : null;\n this.segmentProvider = new SegmentProvider(dataSource, this.ioConfig.getInputSpec());\n this.partitionConfigurationManager = new PartitionConfigurationManager(this.tuningConfig);\n\nCallgraph: \t[CompactionTask->[createContextForSubtask->[getPriority],createDimensionsSpec->[getType],Builder->[build->[CompactionTask]],runTask->[isReady]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWhat happens if both segmentGranularity & granularitySpec are non-null? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -40,7 +40,7 @@ public class ArrayConcat {\n }\n final int leftSize = left != null ? left.size() : 0;\n final int rightSize = right != null ? right.size() : 0;\n- final List<T> result = new ArrayList(leftSize + rightSize);\n+ final List<T> result = new ArrayList<>(leftSize + rightSize);\n if (left != null) {\n result.addAll(left);\n }\n\nCallgraph: \t[ArrayConcat->[concat->[ArrayList,addAll,size]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nMinor side improvement to get rid or compiler warning. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -391,7 +391,9 @@ public class HoodieDeltaStreamer implements Serializable {\n ValidationUtils.checkArgument(!cfg.filterDupes || cfg.operation != Operation.UPSERT,\n \"'--filter-dupes' needs to be disabled when '--op' is 'UPSERT' to ensure updates are not missed.\");\n \n- this.props = properties != null ? properties : UtilHelpers.readConfig(fs, new Path(cfg.propsFilePath), cfg.configs).getConfig();\n+ this.props = properties != null ? properties : UtilHelpers.readConfig(\n+ FSUtils.getFs(cfg.propsFilePath, jssc.hadoopConfiguration()),\n+ new Path(cfg.propsFilePath), cfg.configs).getConfig();\n LOG.info(\"Creating delta streamer with configs : \" + props.toString());\n this.schemaProvider = UtilHelpers.createSchemaProvider(cfg.schemaProviderClassName, props, jssc);\n \n\nCallgraph: \t[HoodieDeltaStreamer->[DeltaSyncService->[startService->[isAsyncCompactionEnabled],onInitializingWriteClient->[isAsyncCompactionEnabled],close->[close]],main->[sync,Config]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nLet us make it flexible in HoodieMultiTableDeltaStreamer as well? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -73,7 +73,14 @@ public class ExprUtils\n } else {\n Chronology chronology = timeZone == null ? ISOChronology.getInstanceUTC() : ISOChronology.getInstance(timeZone);\n final Object value = originArg.eval(bindings).value();\n- origin = value != null ? new DateTime(value, chronology) : null;\n+ if (value instanceof String && StringUtils.isEmpty((String) value)) {\n+ // We get a blank string here, when sql compatible null handling is enabled\n+ // and expression contains empty string for for origin\n+ // e.g timestamp_floor(\\\"__time\\\",'PT1M','','UTC')\n+ origin = null;\n+ } else {\n+ origin = value != null ? new DateTime(value, chronology) : null;\n+ }\n }\n \n return new PeriodGranularity(period, origin, timeZone);\n\nCallgraph: \t[ExprUtils->[toTimeZone->[isLiteral,getLiteralValue,IAE,inferTzfromString],toPeriodGranularity->[value,inferTzfromString,getInstance,getInstanceUTC,DateTime,PeriodGranularity,asString,Period]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThis `StringUtils.isEmpty()` is a dangerously-named synonym of `isNullOrEmpty()`, although it won't make difference here, because of the `value instanceof String` check guaranteeing that the value is not null. Please prohibit this whole `org.apache.commons.lang.StringUtils` class on forbidden-apis level. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -191,7 +191,10 @@ public class FindFiles {\n Snapshot snapshot = snapshotId != null ?\n ops.current().snapshot(snapshotId) : ops.current().currentSnapshot();\n \n- CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, snapshot.manifests())\n+ // snapshot could be null when the table just gets created\n+ Iterable<ManifestFile> manifests = (snapshot != null) ? snapshot.manifests() : CloseableIterable.empty();\n+\n+ CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, manifests)\n .filterData(rowFilter)\n .filterFiles(fileFilter)\n .filterPartitions(partitionFilter)\nCallgraph: \t[FindFiles->[Builder->[asOfTime->[inSnapshot],inPartitions->[inPartitions]]]]\nCodereview: ", "role": "user" } ]
c1752542d5b833d3
{ "callgraph": "[OpenTelemetryProtocolExporterEventSource->[FailedToReachCollector->[FailedToReachCollector],ExportMethodException->[ExportMethodException]]]", "msg": "Didn't went with backwards compatibility since it's still in beta", "patch": "@@ -26,11 +26,12 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation\n public static readonly OpenTelemetryProtocolExporterEventSource Log = new OpenTelemetryProtocolExporterEventSource();\n \n [NonEvent]\n- public void FailedToReachCollector(Exception ex)\n+ public void FailedToReachCollector(Uri collectorUri, Exception ex)\n {\n if (Log.IsEnabled(EventLevel.Error, EventKeywords.All))\n {\n- this.FailedToReachCollector(ex.ToInvariantString());\n+ var rawCollectorUri = collectorUri.ToString();\n+ this.FailedToReachCollector(rawCollectorUri, ex.ToInvariantString());\n }\n }\n ", "summary": "FailedToReachCollector - Method failed to reach collector." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -194,8 +194,9 @@ namespace System.Text.Json\n }\n }\n \n+ [DoesNotReturn]\n [MethodImpl(MethodImplOptions.NoInlining)]\n- public static void ReThrowWithPath(in WriteStack writeStack, Exception ex)\n+ public static void ReThrowWithPath(in WriteStack writeStack, Exception? ex)\n {\n JsonException jsonException = new JsonException(null, ex);\n AddExceptionInformation(writeStack, jsonException);\n\nCallgraph: \t[ThrowHelper->[ReThrowWithPath->[AddExceptionInformation]]]\nCodereview: ", "role": "user" }, { "content": "Same here. Remove nullability annotation? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -26,11 +26,12 @@ public class SynchronousUntilSuccessfulProcessingStrategy extends AbstractUntilS\n protected transient Log logger = LogFactory.getLog(getClass());\n \n @Override\n- public MuleEvent route(MuleEvent event) throws MessagingException\n+ protected MuleEvent doRoute(MuleEvent event) throws MessagingException\n {\n Exception lastExecutionException = null;\n try\n {\n+ MuleEvent retryEvent = DefaultMuleEvent.copy(event);\n for (int i = 0; i <= getUntilSuccessfulConfiguration().getMaxRetries(); i++)\n {\n try\n\nCallgraph: \t[SynchronousUntilSuccessfulProcessingStrategy->[initialise->[InitialisationException,getThreadingProfile,createStaticMessage,getDlqMP,getObjectStore],route->[getMessage,processEvent,debug,sleep,RoutingException,processResponseThroughAckResponseExpression,getMillisBetweenRetries,isDebugEnabled,info,getMaxRetries,getRouter],getLog,getClass]]\nCodereview: ", "role": "user" }, { "content": "if this is a copy then this is not the originalEvent </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -5222,7 +5222,7 @@ namespace System.Tests\n }\n \n [Fact]\n- public static void ToLower()\n+ public static void ToLower_2()\n {\n var expectedSource = new char[3] { 'a', 'B', 'c' };\n var expectedDestination = new char[3] { 'a', 'b', 'c' };\n\nCallgraph: \t[StringTests->[PadRight->[PadRight],IndexOfAny_InvalidCount_ThrowsArgumentOutOfRangeException->[IndexOfAny],IsNullOrEmpty->[IsNullOrEmpty],LastIndexOfSequenceZeroLengthValue_Char->[Length],ToLowerInvariant->[ToLowerInvariant,Length],SameValueCompareTo_StringComparison->[Compare],IndexOfAny_NullAnyOf_ThrowsArgumentNullException->[IndexOfAny],ZeroLengthEndsWith_StringComparison->[EndsWith],ToString->[ToString],SameSpanContains_StringComparison->[Contains],SequenceCompareToNoMatch_Char->[Compare],TrimCharacterAtEnd->[Trim,TrimEnd,TrimStart],MakeSureNoCompareToChecksGoOutOfRange_StringComparison->[Compare],CompareTest->[Compare,Length],Insert_Invalid->[Insert],LengthMismatchToLower->[ToLower,ToLowerInvariant,Length],Equals->[Equals],TrimCharactersInMiddle->[Length,Trim,ToCharArray,TrimEnd,TrimStart],OnlyWhiteSpaceTrim->[Trim,TrimEnd,TrimStart],Equals_InvalidComparisonType_ThrowsArgumentOutOfRangeException->[Equals],EndsWithMatchNonOrdinal_StringComparison->[EndsWith],NoWhiteSpaceTrim->[Trim,TrimEnd,TrimStart],Compare_Invalid->[Compare],ToUpper_TurkishI_InvariantCulture->[ToString,Equals,ToUpper,Length],StartsWithNoMatch_StringComparison->[StartsWith,ToString],OnlyTrimCharacters->[Length,Trim,ToCharArray,TrimEnd,TrimStart],CopyTo->[Length,CopyTo],ToCharArray_Invalid->[ToCharArray],TrimCharactersAtEnd->[ToCharArray,Trim,TrimEnd,TrimStart],ToUpper_TurkishI_EnglishUSCulture_MemberData->[ToUpper_TurkishI_MemberData],LengthMismatchStartsWith_Char->[StartsWith],LengthMismatchStartsWith_StringComparison->[StartsWith],TrimEnd->[ToString,TrimEnd,Length],WhiteSpaceAtEndTrim->[Trim,TrimEnd,TrimStart],ZeroLengthEndsWith_Char->[EndsWith],LastIndexOfAny->[LastIndexOfAny,Length],Remove_Invalid->[Remove,Length],IsWhiteSpaceFalse->[Length],ToUpperInvariant->[ToString,ToUpperInvariant,Length],MakeSureNoContainsChecksGoOutOfRange_StringComparison->[Contains],WhiteSpaceInMiddleTrim->[Trim,TrimEnd,TrimStart],StartEndWithTest->[StartsWith,EndsWith],Permute->[Length,Permute],Remove->[Remove,Length],SameSpanStartsWith_StringComparison->[StartsWith],ToUpper_TurkishI_EnglishUSCulture->[ToString,Equals,ToUpper,Length],EndsWithNoMatchNonOrdinal_StringComparison->[EndsWith],MakeSureNoSequenceCompareToChecksGoOutOfRange_Char->[Compare],MakeSureNoEndsWithChecksGoOutOfRange_StringComparison->[EndsWith],StartsWithMatch_StringComparison->[StartsWith],MakeSureNoTrimChecksGoOutOfRange->[Trim,TrimEnd,TrimStart],GetEnumerator_Generic->[Length],ZeroLengthTrimCharacters->[ToCharArray,Trim,TrimEnd,TrimStart],Length->[Length],GetEnumeratorTest->[Length],SameSpanEndsWith_Char->[EndsWith],Insert->[Insert],CompareToNoMatch_StringComparison->[Compare],StartsWithMatchDifferentSpans_StringComparison->[StartsWith],ContainsMatch_StringComparison->[Contains],AllSubstringsAndComparisons->[Substring,Length],EndsWithMatch_Char->[EndsWith],MakeSureNoToUpperChecksGoOutOfRange->[ToCharArray,ToUpper,Length],ToUpper_TurkishI_InvariantCulture_MemberData->[ToUpper_TurkishI_MemberData],GetEnumerator_NonGeneric->[Length],LastIndexOf_Invalid->[Length],IndexOf_SingleLetter->[Length],MakeSureNoStartsWithChecksGoOutOfRange_Char->[StartsWith],MakeSureNoTrimCharacterChecksGoOutOfRange->[Trim,TrimEnd,TrimStart],StartEndNegativeTest->[StartsWith,EndsWith],EndsWith_Invalid->[EndsWith],StartsWith_Invalid->[StartsWith],LengthMismatchContains_StringComparison->[Contains],Contains_NullValue_ThrowsArgumentNullException->[Contains],Test_ToLower_Culture->[ToLower_Culture_TestData],IsWhiteSpaceTrueLatin1->[Length],OnlyTrimCharacter->[Trim,TrimEnd,TrimStart],EndsWithNoMatch_Char->[EndsWith],SameSpanStartsWith_Char->[StartsWith],ToUpper_TurkishI_TurkishCulture_MemberData->[ToUpper_TurkishI_MemberData],StartsWithNoMatch_Char->[StartsWith],ZeroLengthStartsWith_Char->[StartsWith],StartsWith_NullInStrings_NonOrdinal->[StartsWith],CompareToMatchDifferentInstances_StringComparison->[Compare],EndsWith_NullInStrings->[EndsWith],IsSafeForCurrentCultureComparisons->[Length],MakeSureNoTrimCharactersChecksGoOutOfRange->[Length,Substring,Trim,ToCharArray,TrimEnd,TrimStart],LastIndexOfAny_Invalid->[LastIndexOfAny],StartsWith_NullInStrings->[StartsWith],ZeroLengthCompareTo_StringComparison->[Compare],TrimCharacterAtStartAndEnd->[Trim,TrimEnd,TrimStart],ToCharArray->[ToCharArray,Length],TrimCharactersAtStart->[ToCharArray,Trim,TrimEnd,TrimStart],Format_Invalid->[Format],InternTest->[ToString,Equals],ZeroLengthStartsWith_StringComparison->[StartsWith],ContainsNoMatch_StringComparison->[Contains],Join_StringArray->[Length],ToLower->[ToCharArray,ToLowerInvariant,ToLower,Length],ToLower_Culture->[Equals,ToLower,Length],CompareToUnknownComparisonType_StringComparison->[Compare],LengthMismatchEndsWith_StringComparison->[EndsWith],EndsWithMatchDifferentSpans_StringComparison->[EndsWith],IndexOfAny_InvalidStartIndex_ThrowsArgumentOutOfRangeException->[IndexOfAny],TrimCharactersAtStartAndEnd->[ToCharArray,Trim,TrimEnd,TrimStart],ToLowerToUpperInvariant_ASCII->[ToString,ToLowerInvariant,ToUpperInvariant,Length],ToUpper_TurkishI_TurkishCulture->[ToString,Equals,ToUpper,Length],PadLeft->[PadLeft],PadRight_NegativeTotalWidth_ThrowsArgumentOutOfRangeException->[PadRight],CopyTo_Invalid->[Length,CopyTo],StartsWithUnknownComparisonType_StringComparison->[StartsWith],IndexOf_AllSubstrings->[Length],EndsWithMatch_StringComparison->[EndsWith],LengthMismatchEndsWith_Char->[EndsWith],ZeroLengthContains_StringComparison->[Contains],ZeroLengthToUpper->[Length],TrimCharacterMultipleTimes->[Trim,TrimEnd,TrimStart],Contains->[Contains],Concat_Objects->[Length],ContainsMatchDifferentSpans_StringComparison->[Contains],EndsWith_StringBoolCultureInfo_Valid->[EndsWith],EndsWith_NullInStrings_NonOrdinal->[EndsWith],Substring_Invalid->[Substring],IConvertible_ValuesRoundtripThroughString->[ToString],NoTrimCharacter->[Trim,TrimEnd,TrimStart],IndexOfAny->[IndexOfAny,Length],TrimCharactersMultipleTimes->[ToCharArray,Trim,TrimEnd,TrimStart],ZeroLengthToLower->[ToLower,ToLowerInvariant,Length],Ctor_SByte->[Length],SameSpanToLower->[ToLower,ToLowerInvariant],Format->[Format],PadLeft_NegativeTotalWidth_ThrowsArgumentOutOfRangeException->[PadLeft],TrimCharacterInMiddle->[Trim,TrimEnd,TrimStart],MakeSureNoToLowerChecksGoOutOfRange->[ToCharArray,ToLowerInvariant,ToLower,Length],TrimStart->[ToString,Length,TrimStart],CompareToOverlappingMatch_StringComparison->[Compare],TrimWhiteSpaceMultipleTimes->[Trim,TrimEnd,TrimStart],Test_ToUpper_Culture->[ToUpper,Length],WhiteSpaceAtStartTrim->[Trim,TrimEnd,TrimStart],Compare->[Compare,Length],Trim->[ToString,Trim,Length],SequenceCompareToWithSingleMismatch_Char->[Compare],LastIndexOf_AllSubstrings->[Length],LengthMismatchToUpper->[Length],StartsWithMatch_Char->[StartsWith],ToLowerOverlapping->[ToLower,ToLowerInvariant],StartsWithNoMatchNonOrdinal_StringComparison->[StartsWith],NoTrimCharacters->[ToCharArray,Trim,TrimEnd,TrimStart],StartsWith->[StartsWith],EndsWithNoMatch_StringComparison->[EndsWith],StartsWithMatchDifferentSpans_Char->[StartsWith],WhiteSpaceAtStartAndEndTrim->[Trim,TrimEnd,TrimStart],IsWhiteSpaceTrue->[Length],StartsWithMatchNonOrdinal_StringComparison->[StartsWith,ToString],LengthMismatchCompareTo_StringComparison->[Compare],LastIndexOf_SingleLetter->[Length],SameSpanEndsWith_StringComparison->[EndsWith],EndsWithUnknownComparisonType_StringComparison->[EndsWith],ZeroLengthTrimCharacter->[Trim,TrimEnd,TrimStart],EndsWithMatchDifferentSpans_Char->[EndsWith],MakeSureNoEndsWithChecksGoOutOfRange_Char->[EndsWith],MakeSureNoStartsWithChecksGoOutOfRange_StringComparison->[StartsWith],Concat_String->[Length],Substring->[Substring,Length],CasingTest->[ToString,ToLower,Length,ToUpper],TrimCharacterAtStart->[Trim,TrimEnd,TrimStart],EndsWith->[EndsWith],ToUpper->[ToCharArray,ToString,ToUpper,Length],ZeroLengthTrim->[Trim,TrimEnd,TrimStart],Compare_LongString->[Compare],Equals_Encyclopaedia_ReturnsExpected->[Equals]]]\nCodereview: ", "role": "user" }, { "content": "What is the other ToLower test this is conflicting with? \"ToLower_2\" isn't descriptive about what makes this test different from a presumed \"ToLower_1\", so we should either pick descriptive names or combine the tests. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -41,9 +41,9 @@ namespace System.Collections.Tests\n #region Constructors\n \n [Fact]\n- public void PriorityQueue_Generic_Constructor()\n+ public void PriorityQueue_DefaultConstructor_ComparerEqualsDefaultComparer()\n {\n- var queue = new PriorityQueue<TElement, TPriority>();\n+ var queue = new PriorityQueue<TPriority, TPriority>();\n \n Assert.Equal(expected: 0, queue.Count);\n Assert.Empty(queue.UnorderedItems);\n\nCallgraph: \t[PriorityQueue_Generic_Tests->[PriorityQueue_Enumeration_InvalidationOnModifiedCapacity->[GenericPriorityQueueFactory,GetUnderlyingBufferCapacity],PriorityQueue_Generic_PeekAndDequeue->[GenericPriorityQueueFactory],PriorityQueue_Generic_TrimExcess_Repeatedly->[GenericPriorityQueueFactory],PriorityQueue_Generic_Clear->[GenericPriorityQueueFactory],PriorityQueue_Generic_Enqueue->[GenericPriorityQueueFactory],PriorityQueue_Enumeration_OrderingIsConsistent->[GenericPriorityQueueFactory],PriorityQueue_Generic_TrimExcess_ValidQueueThatHasntBeenRemovedFrom->[GenericPriorityQueueFactory]]]\nCodereview: ", "role": "user" }, { "content": "Was this a purposeful change? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -64,13 +64,13 @@ public class TestMemoryDirectory extends NXRuntimeTestCase {\n static final String SCHEMA_NAME = \"myschema\";\n \n @Override\n- @Before\n public void setUp() throws Exception {\n- super.setUp();\n-\n deployBundle(\"org.nuxeo.ecm.core.schema\");\n deployContrib(\"org.nuxeo.ecm.directory.core.tests\", \"test-schema.xml\");\n+ }\n \n+ @Override\n+ protected void postSetUp() throws Exception {\n MemoryDirectoryDescriptor descr = new MemoryDirectoryDescriptor();\n descr.name = \"mydir\";\n descr.schemaName = SCHEMA_NAME;\n\nCallgraph: \t[TestMemoryDirectory->[testOrderBy->[entryIds],setUp->[setUp]]]\nCodereview: ", "role": "user" }, { "content": "- use of `deployContrib` with a test contribution </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -26,11 +26,12 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation\n public static readonly OpenTelemetryProtocolExporterEventSource Log = new OpenTelemetryProtocolExporterEventSource();\n \n [NonEvent]\n- public void FailedToReachCollector(Exception ex)\n+ public void FailedToReachCollector(Uri collectorUri, Exception ex)\n {\n if (Log.IsEnabled(EventLevel.Error, EventKeywords.All))\n {\n- this.FailedToReachCollector(ex.ToInvariantString());\n+ var rawCollectorUri = collectorUri.ToString();\n+ this.FailedToReachCollector(rawCollectorUri, ex.ToInvariantString());\n }\n }\n \nCallgraph: \t[OpenTelemetryProtocolExporterEventSource->[FailedToReachCollector->[FailedToReachCollector],ExportMethodException->[ExportMethodException]]]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -194,8 +194,9 @@ namespace System.Text.Json\n }\n }\n \n+ [DoesNotReturn]\n [MethodImpl(MethodImplOptions.NoInlining)]\n- public static void ReThrowWithPath(in WriteStack writeStack, Exception ex)\n+ public static void ReThrowWithPath(in WriteStack writeStack, Exception? ex)\n {\n JsonException jsonException = new JsonException(null, ex);\n AddExceptionInformation(writeStack, jsonException);\n\nCallgraph: \t[ThrowHelper->[ReThrowWithPath->[AddExceptionInformation]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nSame here. Remove nullability annotation? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -26,11 +26,12 @@ public class SynchronousUntilSuccessfulProcessingStrategy extends AbstractUntilS\n protected transient Log logger = LogFactory.getLog(getClass());\n \n @Override\n- public MuleEvent route(MuleEvent event) throws MessagingException\n+ protected MuleEvent doRoute(MuleEvent event) throws MessagingException\n {\n Exception lastExecutionException = null;\n try\n {\n+ MuleEvent retryEvent = DefaultMuleEvent.copy(event);\n for (int i = 0; i <= getUntilSuccessfulConfiguration().getMaxRetries(); i++)\n {\n try\n\nCallgraph: \t[SynchronousUntilSuccessfulProcessingStrategy->[initialise->[InitialisationException,getThreadingProfile,createStaticMessage,getDlqMP,getObjectStore],route->[getMessage,processEvent,debug,sleep,RoutingException,processResponseThroughAckResponseExpression,getMillisBetweenRetries,isDebugEnabled,info,getMaxRetries,getRouter],getLog,getClass]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nif this is a copy then this is not the originalEvent </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -5222,7 +5222,7 @@ namespace System.Tests\n }\n \n [Fact]\n- public static void ToLower()\n+ public static void ToLower_2()\n {\n var expectedSource = new char[3] { 'a', 'B', 'c' };\n var expectedDestination = new char[3] { 'a', 'b', 'c' };\n\nCallgraph: \t[StringTests->[PadRight->[PadRight],IndexOfAny_InvalidCount_ThrowsArgumentOutOfRangeException->[IndexOfAny],IsNullOrEmpty->[IsNullOrEmpty],LastIndexOfSequenceZeroLengthValue_Char->[Length],ToLowerInvariant->[ToLowerInvariant,Length],SameValueCompareTo_StringComparison->[Compare],IndexOfAny_NullAnyOf_ThrowsArgumentNullException->[IndexOfAny],ZeroLengthEndsWith_StringComparison->[EndsWith],ToString->[ToString],SameSpanContains_StringComparison->[Contains],SequenceCompareToNoMatch_Char->[Compare],TrimCharacterAtEnd->[Trim,TrimEnd,TrimStart],MakeSureNoCompareToChecksGoOutOfRange_StringComparison->[Compare],CompareTest->[Compare,Length],Insert_Invalid->[Insert],LengthMismatchToLower->[ToLower,ToLowerInvariant,Length],Equals->[Equals],TrimCharactersInMiddle->[Length,Trim,ToCharArray,TrimEnd,TrimStart],OnlyWhiteSpaceTrim->[Trim,TrimEnd,TrimStart],Equals_InvalidComparisonType_ThrowsArgumentOutOfRangeException->[Equals],EndsWithMatchNonOrdinal_StringComparison->[EndsWith],NoWhiteSpaceTrim->[Trim,TrimEnd,TrimStart],Compare_Invalid->[Compare],ToUpper_TurkishI_InvariantCulture->[ToString,Equals,ToUpper,Length],StartsWithNoMatch_StringComparison->[StartsWith,ToString],OnlyTrimCharacters->[Length,Trim,ToCharArray,TrimEnd,TrimStart],CopyTo->[Length,CopyTo],ToCharArray_Invalid->[ToCharArray],TrimCharactersAtEnd->[ToCharArray,Trim,TrimEnd,TrimStart],ToUpper_TurkishI_EnglishUSCulture_MemberData->[ToUpper_TurkishI_MemberData],LengthMismatchStartsWith_Char->[StartsWith],LengthMismatchStartsWith_StringComparison->[StartsWith],TrimEnd->[ToString,TrimEnd,Length],WhiteSpaceAtEndTrim->[Trim,TrimEnd,TrimStart],ZeroLengthEndsWith_Char->[EndsWith],LastIndexOfAny->[LastIndexOfAny,Length],Remove_Invalid->[Remove,Length],IsWhiteSpaceFalse->[Length],ToUpperInvariant->[ToString,ToUpperInvariant,Length],MakeSureNoContainsChecksGoOutOfRange_StringComparison->[Contains],WhiteSpaceInMiddleTrim->[Trim,TrimEnd,TrimStart],StartEndWithTest->[StartsWith,EndsWith],Permute->[Length,Permute],Remove->[Remove,Length],SameSpanStartsWith_StringComparison->[StartsWith],ToUpper_TurkishI_EnglishUSCulture->[ToString,Equals,ToUpper,Length],EndsWithNoMatchNonOrdinal_StringComparison->[EndsWith],MakeSureNoSequenceCompareToChecksGoOutOfRange_Char->[Compare],MakeSureNoEndsWithChecksGoOutOfRange_StringComparison->[EndsWith],StartsWithMatch_StringComparison->[StartsWith],MakeSureNoTrimChecksGoOutOfRange->[Trim,TrimEnd,TrimStart],GetEnumerator_Generic->[Length],ZeroLengthTrimCharacters->[ToCharArray,Trim,TrimEnd,TrimStart],Length->[Length],GetEnumeratorTest->[Length],SameSpanEndsWith_Char->[EndsWith],Insert->[Insert],CompareToNoMatch_StringComparison->[Compare],StartsWithMatchDifferentSpans_StringComparison->[StartsWith],ContainsMatch_StringComparison->[Contains],AllSubstringsAndComparisons->[Substring,Length],EndsWithMatch_Char->[EndsWith],MakeSureNoToUpperChecksGoOutOfRange->[ToCharArray,ToUpper,Length],ToUpper_TurkishI_InvariantCulture_MemberData->[ToUpper_TurkishI_MemberData],GetEnumerator_NonGeneric->[Length],LastIndexOf_Invalid->[Length],IndexOf_SingleLetter->[Length],MakeSureNoStartsWithChecksGoOutOfRange_Char->[StartsWith],MakeSureNoTrimCharacterChecksGoOutOfRange->[Trim,TrimEnd,TrimStart],StartEndNegativeTest->[StartsWith,EndsWith],EndsWith_Invalid->[EndsWith],StartsWith_Invalid->[StartsWith],LengthMismatchContains_StringComparison->[Contains],Contains_NullValue_ThrowsArgumentNullException->[Contains],Test_ToLower_Culture->[ToLower_Culture_TestData],IsWhiteSpaceTrueLatin1->[Length],OnlyTrimCharacter->[Trim,TrimEnd,TrimStart],EndsWithNoMatch_Char->[EndsWith],SameSpanStartsWith_Char->[StartsWith],ToUpper_TurkishI_TurkishCulture_MemberData->[ToUpper_TurkishI_MemberData],StartsWithNoMatch_Char->[StartsWith],ZeroLengthStartsWith_Char->[StartsWith],StartsWith_NullInStrings_NonOrdinal->[StartsWith],CompareToMatchDifferentInstances_StringComparison->[Compare],EndsWith_NullInStrings->[EndsWith],IsSafeForCurrentCultureComparisons->[Length],MakeSureNoTrimCharactersChecksGoOutOfRange->[Length,Substring,Trim,ToCharArray,TrimEnd,TrimStart],LastIndexOfAny_Invalid->[LastIndexOfAny],StartsWith_NullInStrings->[StartsWith],ZeroLengthCompareTo_StringComparison->[Compare],TrimCharacterAtStartAndEnd->[Trim,TrimEnd,TrimStart],ToCharArray->[ToCharArray,Length],TrimCharactersAtStart->[ToCharArray,Trim,TrimEnd,TrimStart],Format_Invalid->[Format],InternTest->[ToString,Equals],ZeroLengthStartsWith_StringComparison->[StartsWith],ContainsNoMatch_StringComparison->[Contains],Join_StringArray->[Length],ToLower->[ToCharArray,ToLowerInvariant,ToLower,Length],ToLower_Culture->[Equals,ToLower,Length],CompareToUnknownComparisonType_StringComparison->[Compare],LengthMismatchEndsWith_StringComparison->[EndsWith],EndsWithMatchDifferentSpans_StringComparison->[EndsWith],IndexOfAny_InvalidStartIndex_ThrowsArgumentOutOfRangeException->[IndexOfAny],TrimCharactersAtStartAndEnd->[ToCharArray,Trim,TrimEnd,TrimStart],ToLowerToUpperInvariant_ASCII->[ToString,ToLowerInvariant,ToUpperInvariant,Length],ToUpper_TurkishI_TurkishCulture->[ToString,Equals,ToUpper,Length],PadLeft->[PadLeft],PadRight_NegativeTotalWidth_ThrowsArgumentOutOfRangeException->[PadRight],CopyTo_Invalid->[Length,CopyTo],StartsWithUnknownComparisonType_StringComparison->[StartsWith],IndexOf_AllSubstrings->[Length],EndsWithMatch_StringComparison->[EndsWith],LengthMismatchEndsWith_Char->[EndsWith],ZeroLengthContains_StringComparison->[Contains],ZeroLengthToUpper->[Length],TrimCharacterMultipleTimes->[Trim,TrimEnd,TrimStart],Contains->[Contains],Concat_Objects->[Length],ContainsMatchDifferentSpans_StringComparison->[Contains],EndsWith_StringBoolCultureInfo_Valid->[EndsWith],EndsWith_NullInStrings_NonOrdinal->[EndsWith],Substring_Invalid->[Substring],IConvertible_ValuesRoundtripThroughString->[ToString],NoTrimCharacter->[Trim,TrimEnd,TrimStart],IndexOfAny->[IndexOfAny,Length],TrimCharactersMultipleTimes->[ToCharArray,Trim,TrimEnd,TrimStart],ZeroLengthToLower->[ToLower,ToLowerInvariant,Length],Ctor_SByte->[Length],SameSpanToLower->[ToLower,ToLowerInvariant],Format->[Format],PadLeft_NegativeTotalWidth_ThrowsArgumentOutOfRangeException->[PadLeft],TrimCharacterInMiddle->[Trim,TrimEnd,TrimStart],MakeSureNoToLowerChecksGoOutOfRange->[ToCharArray,ToLowerInvariant,ToLower,Length],TrimStart->[ToString,Length,TrimStart],CompareToOverlappingMatch_StringComparison->[Compare],TrimWhiteSpaceMultipleTimes->[Trim,TrimEnd,TrimStart],Test_ToUpper_Culture->[ToUpper,Length],WhiteSpaceAtStartTrim->[Trim,TrimEnd,TrimStart],Compare->[Compare,Length],Trim->[ToString,Trim,Length],SequenceCompareToWithSingleMismatch_Char->[Compare],LastIndexOf_AllSubstrings->[Length],LengthMismatchToUpper->[Length],StartsWithMatch_Char->[StartsWith],ToLowerOverlapping->[ToLower,ToLowerInvariant],StartsWithNoMatchNonOrdinal_StringComparison->[StartsWith],NoTrimCharacters->[ToCharArray,Trim,TrimEnd,TrimStart],StartsWith->[StartsWith],EndsWithNoMatch_StringComparison->[EndsWith],StartsWithMatchDifferentSpans_Char->[StartsWith],WhiteSpaceAtStartAndEndTrim->[Trim,TrimEnd,TrimStart],IsWhiteSpaceTrue->[Length],StartsWithMatchNonOrdinal_StringComparison->[StartsWith,ToString],LengthMismatchCompareTo_StringComparison->[Compare],LastIndexOf_SingleLetter->[Length],SameSpanEndsWith_StringComparison->[EndsWith],EndsWithUnknownComparisonType_StringComparison->[EndsWith],ZeroLengthTrimCharacter->[Trim,TrimEnd,TrimStart],EndsWithMatchDifferentSpans_Char->[EndsWith],MakeSureNoEndsWithChecksGoOutOfRange_Char->[EndsWith],MakeSureNoStartsWithChecksGoOutOfRange_StringComparison->[StartsWith],Concat_String->[Length],Substring->[Substring,Length],CasingTest->[ToString,ToLower,Length,ToUpper],TrimCharacterAtStart->[Trim,TrimEnd,TrimStart],EndsWith->[EndsWith],ToUpper->[ToCharArray,ToString,ToUpper,Length],ZeroLengthTrim->[Trim,TrimEnd,TrimStart],Compare_LongString->[Compare],Equals_Encyclopaedia_ReturnsExpected->[Equals]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWhat is the other ToLower test this is conflicting with? \"ToLower_2\" isn't descriptive about what makes this test different from a presumed \"ToLower_1\", so we should either pick descriptive names or combine the tests. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -41,9 +41,9 @@ namespace System.Collections.Tests\n #region Constructors\n \n [Fact]\n- public void PriorityQueue_Generic_Constructor()\n+ public void PriorityQueue_DefaultConstructor_ComparerEqualsDefaultComparer()\n {\n- var queue = new PriorityQueue<TElement, TPriority>();\n+ var queue = new PriorityQueue<TPriority, TPriority>();\n \n Assert.Equal(expected: 0, queue.Count);\n Assert.Empty(queue.UnorderedItems);\n\nCallgraph: \t[PriorityQueue_Generic_Tests->[PriorityQueue_Enumeration_InvalidationOnModifiedCapacity->[GenericPriorityQueueFactory,GetUnderlyingBufferCapacity],PriorityQueue_Generic_PeekAndDequeue->[GenericPriorityQueueFactory],PriorityQueue_Generic_TrimExcess_Repeatedly->[GenericPriorityQueueFactory],PriorityQueue_Generic_Clear->[GenericPriorityQueueFactory],PriorityQueue_Generic_Enqueue->[GenericPriorityQueueFactory],PriorityQueue_Enumeration_OrderingIsConsistent->[GenericPriorityQueueFactory],PriorityQueue_Generic_TrimExcess_ValidQueueThatHasntBeenRemovedFrom->[GenericPriorityQueueFactory]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWas this a purposeful change? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -64,13 +64,13 @@ public class TestMemoryDirectory extends NXRuntimeTestCase {\n static final String SCHEMA_NAME = \"myschema\";\n \n @Override\n- @Before\n public void setUp() throws Exception {\n- super.setUp();\n-\n deployBundle(\"org.nuxeo.ecm.core.schema\");\n deployContrib(\"org.nuxeo.ecm.directory.core.tests\", \"test-schema.xml\");\n+ }\n \n+ @Override\n+ protected void postSetUp() throws Exception {\n MemoryDirectoryDescriptor descr = new MemoryDirectoryDescriptor();\n descr.name = \"mydir\";\n descr.schemaName = SCHEMA_NAME;\n\nCallgraph: \t[TestMemoryDirectory->[testOrderBy->[entryIds],setUp->[setUp]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\n- use of `deployContrib` with a test contribution </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -26,11 +26,12 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation\n public static readonly OpenTelemetryProtocolExporterEventSource Log = new OpenTelemetryProtocolExporterEventSource();\n \n [NonEvent]\n- public void FailedToReachCollector(Exception ex)\n+ public void FailedToReachCollector(Uri collectorUri, Exception ex)\n {\n if (Log.IsEnabled(EventLevel.Error, EventKeywords.All))\n {\n- this.FailedToReachCollector(ex.ToInvariantString());\n+ var rawCollectorUri = collectorUri.ToString();\n+ this.FailedToReachCollector(rawCollectorUri, ex.ToInvariantString());\n }\n }\n \nCallgraph: \t[OpenTelemetryProtocolExporterEventSource->[FailedToReachCollector->[FailedToReachCollector],ExportMethodException->[ExportMethodException]]]\nCodereview: ", "role": "user" } ]
7dc3d2474c83cca7
{ "callgraph": "[replace,fieldRow,dispose,isShadow,utils,outputConnection,setAttribute,substring,name,Colours,stringify,map,require,WidgetDiv,DUMMY_INPUT,FieldTextInputRemovable,setCheck,provide,setShadow,Blocks,render,dom,setFieldValue,initSvg,appendChild,ScratchBlocks,parse,connection,INPUT_VALUE,Events,trim,type,getField,getFieldValue,getAttribute,createElement]", "msg": "Is this actually a lint related change?", "patch": "@@ -185,7 +185,7 @@ Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_ = function() {\n */\n Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_ = function(connectionMap) {\n // Split the proc into components, by %n, %b, and %s (ignoring escaped).\n- var procComponents = this.procCode_.split(/(?=[^\\\\]\\%[nbs])/);\n+ var procComponents = this.procCode_.split(/(?=[^\\\\]%[nbs])/);\n procComponents = procComponents.map(function(c) {\n return c.trim(); // Strip whitespace.\n });", "summary": "Creates all inputs of a block and removes all inputs on the block including dummy inputs. function to populate the input." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -329,7 +329,7 @@ define([\n iso8601String = iso8601String.replace(',', '.');\n \n //Split the string into its date and time components, denoted by a mandatory T\n- var tokens = iso8601String.split('T'), year, month = 1, day = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0;\n+ var tokens = iso8601String.split('T'), year, month = 1, day = 1, hour = 0, minute = 0, second = 0, millisecond = 0;\n \n //Lacking a time is okay, but a missing date is illegal.\n var date = tokens[0];\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "I know it's kind of verbose, but we generally avoid multi-variable var statements like this, especially when there's initialization scattered throughout. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -21,10 +21,14 @@ var $buo = function() {\n document.getElementsByTagName('body')[0].classList.add(\"crawler\");\n var mainElement = document.getElementById(\"main\");\n var noscriptElements = document.getElementsByTagName(\"noscript\");\n- // noscriptElements[0].innerHTML contains encoded HTML\n- var innerHTML = noscriptElements[0].childNodes[0].nodeValue;\n- mainElement.innerHTML = innerHTML;\n-\n+ // find the element with the \"data-path\" attribute set\n+ for (var i = 0; i < noscriptElements.length; ++i) {\n+ if (noscriptElements[i].dataset[\"path\"]) {\n+ // noscriptElements[i].innerHTML contains encoded HTML\n+ mainElement.innerHTML = noscriptElements[i].childNodes[0].nodeValue;\n+ break;\n+ }\n+ }\n // retrieve localized browser upgrade text\n var t = <%= \"'\" + I18n.t('js.browser_update') + \"'\" %>;\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "How is this a `find`? Looks like you're just iterating over all the items? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -25,13 +25,13 @@ searchDataRequest.onload = function() {\n searchData.forEach(function(page) {\n index.add(page);\n });\n- postMessage({ e: 'index-ready' });\n+ postMessage({e: 'index-ready'});\n };\n searchDataRequest.open('GET', 'search-data.json');\n searchDataRequest.send();\n \n // The worker receives a message everytime the web app wants to query the index\n-onmessage = function(oEvent) {\n+self.onmessage = function(oEvent) {\n var q = oEvent.data.q;\n var hits = index.search(q);\n var results = [];\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Ooc, couldn't this also be `self.postMessage`? Is there any reason why you usd it below but not here (just being curious)? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -348,6 +348,7 @@ function shallowClearAndCopy(src, dst) {\n */\n angular.module('ngResource', ['ng']).\n provider('$resource', function() {\n+ var PROTOCOL_AND_DOMAIN_REGEX = /^http(?:s)?:\\/\\/[^\\/]*/;\n var provider = this;\n \n this.defaults = {\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Why not `(?:s)?` --> `s?` ? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -192,7 +192,7 @@ describe('injector', function() {\n \n \n it('should create $inject', function() {\n- var extraParans = angular.noop;\n+ var extraParams = angular.noop;\n /* eslint-disable space-before-function-paren */\n // keep the multi-line to make sure we can handle it\n function $f_n0 /*\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "It took me a long time to try to decide if this should be `extraParams` or `extraParens`, the initial commit was not remotely helpful. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -185,7 +185,7 @@ Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_ = function() {\n */\n Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_ = function(connectionMap) {\n // Split the proc into components, by %n, %b, and %s (ignoring escaped).\n- var procComponents = this.procCode_.split(/(?=[^\\\\]\\%[nbs])/);\n+ var procComponents = this.procCode_.split(/(?=[^\\\\]%[nbs])/);\n procComponents = procComponents.map(function(c) {\n return c.trim(); // Strip whitespace.\n });\nCallgraph: \t[replace,fieldRow,dispose,isShadow,utils,outputConnection,setAttribute,substring,name,Colours,stringify,map,require,WidgetDiv,DUMMY_INPUT,FieldTextInputRemovable,setCheck,provide,setShadow,Blocks,render,dom,setFieldValue,initSvg,appendChild,ScratchBlocks,parse,connection,INPUT_VALUE,Events,trim,type,getField,getFieldValue,getAttribute,createElement]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -329,7 +329,7 @@ define([\n iso8601String = iso8601String.replace(',', '.');\n \n //Split the string into its date and time components, denoted by a mandatory T\n- var tokens = iso8601String.split('T'), year, month = 1, day = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0;\n+ var tokens = iso8601String.split('T'), year, month = 1, day = 1, hour = 0, minute = 0, second = 0, millisecond = 0;\n \n //Lacking a time is okay, but a missing date is illegal.\n var date = tokens[0];\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nI know it's kind of verbose, but we generally avoid multi-variable var statements like this, especially when there's initialization scattered throughout. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -21,10 +21,14 @@ var $buo = function() {\n document.getElementsByTagName('body')[0].classList.add(\"crawler\");\n var mainElement = document.getElementById(\"main\");\n var noscriptElements = document.getElementsByTagName(\"noscript\");\n- // noscriptElements[0].innerHTML contains encoded HTML\n- var innerHTML = noscriptElements[0].childNodes[0].nodeValue;\n- mainElement.innerHTML = innerHTML;\n-\n+ // find the element with the \"data-path\" attribute set\n+ for (var i = 0; i < noscriptElements.length; ++i) {\n+ if (noscriptElements[i].dataset[\"path\"]) {\n+ // noscriptElements[i].innerHTML contains encoded HTML\n+ mainElement.innerHTML = noscriptElements[i].childNodes[0].nodeValue;\n+ break;\n+ }\n+ }\n // retrieve localized browser upgrade text\n var t = <%= \"'\" + I18n.t('js.browser_update') + \"'\" %>;\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nHow is this a `find`? Looks like you're just iterating over all the items? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -25,13 +25,13 @@ searchDataRequest.onload = function() {\n searchData.forEach(function(page) {\n index.add(page);\n });\n- postMessage({ e: 'index-ready' });\n+ postMessage({e: 'index-ready'});\n };\n searchDataRequest.open('GET', 'search-data.json');\n searchDataRequest.send();\n \n // The worker receives a message everytime the web app wants to query the index\n-onmessage = function(oEvent) {\n+self.onmessage = function(oEvent) {\n var q = oEvent.data.q;\n var hits = index.search(q);\n var results = [];\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nOoc, couldn't this also be `self.postMessage`? Is there any reason why you usd it below but not here (just being curious)? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -348,6 +348,7 @@ function shallowClearAndCopy(src, dst) {\n */\n angular.module('ngResource', ['ng']).\n provider('$resource', function() {\n+ var PROTOCOL_AND_DOMAIN_REGEX = /^http(?:s)?:\\/\\/[^\\/]*/;\n var provider = this;\n \n this.defaults = {\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWhy not `(?:s)?` --> `s?` ? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -192,7 +192,7 @@ describe('injector', function() {\n \n \n it('should create $inject', function() {\n- var extraParans = angular.noop;\n+ var extraParams = angular.noop;\n /* eslint-disable space-before-function-paren */\n // keep the multi-line to make sure we can handle it\n function $f_n0 /*\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nIt took me a long time to try to decide if this should be `extraParams` or `extraParens`, the initial commit was not remotely helpful. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -185,7 +185,7 @@ Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_ = function() {\n */\n Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_ = function(connectionMap) {\n // Split the proc into components, by %n, %b, and %s (ignoring escaped).\n- var procComponents = this.procCode_.split(/(?=[^\\\\]\\%[nbs])/);\n+ var procComponents = this.procCode_.split(/(?=[^\\\\]%[nbs])/);\n procComponents = procComponents.map(function(c) {\n return c.trim(); // Strip whitespace.\n });\nCallgraph: \t[replace,fieldRow,dispose,isShadow,utils,outputConnection,setAttribute,substring,name,Colours,stringify,map,require,WidgetDiv,DUMMY_INPUT,FieldTextInputRemovable,setCheck,provide,setShadow,Blocks,render,dom,setFieldValue,initSvg,appendChild,ScratchBlocks,parse,connection,INPUT_VALUE,Events,trim,type,getField,getFieldValue,getAttribute,createElement]\nCodereview: ", "role": "user" } ]
973d5f8f3c42730f
{ "callgraph": "[RefactoringChecker->[_check_superfluous_else_raise->[_check_superfluous_else],process_tokens->[_is_trailing_comma],_check_nested_blocks->[_is_actual_elif],_check_chained_comparison->[_find_lower_upper_bounds],visit_with->[_check_redefined_argument_from_local],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_if->[_check_superfluous_else_raise,_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_assign->[_check_swap_variables],_check_superfluous_else->[_is_actual_elif,_if_statement_is_always_returning],visit_excepthandler->[_check_redefined_argument_from_local],leave_module->[_init],visit_augassign->[_check_consider_using_join],visit_for->[_check_redefined_argument_from_local],_is_node_return_ended->[_is_node_return_ended],visit_boolop->[_check_chained_comparison,_check_consider_using_in,_check_consider_merging_isinstance],visit_call->[_check_consider_using_comprehension_constructor],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],_check_superfluous_else_return->[_check_superfluous_else],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],_check_consider_get->[type_and_name_are_equal]],RecommandationChecker->[visit_for->[_is_constant_zero,_is_builtin]],_is_trailing_comma->[get_curline_index_start],LenChecker->[visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]", "msg": "I don't know if there are strict conventions about this, but I think the name of the warning should be the diagnosis, not the suggested course of action. In this case, that would mean changing the name of the warning to `interactive-exit` or something like that.", "patch": "@@ -273,6 +273,11 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n \"consider using the list, dict or set constructor. \"\n \"It is faster and simpler.\",\n ),\n+ \"R1722\": (\n+ \"Consider using sys.exit()\",\n+ \"consider-using-sys-exit\",\n+ \"Instead of using exit() or quit(), consider using the sys.exit().\",\n+ ),\n }\n options = (\n (", "summary": "Uses the dict constructor a list of transient objects and a list of objects that can be used A class that checks a name of functions that never returns." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -149,7 +149,8 @@ def simulate_raw(info, stc=None, trans=None, src=None, bem=None, head_pos=None,\n See Notes for details.\n \n .. versionchanged:: 0.18\n- Support for tuple, and iterable of tuple or SourceEstimate.\n+ Support for tuple, iterable of tuple or SourceEstimate,\n+ or SourceSimulator.\n trans : dict | str | None\n Either a transformation filename (usually made using mne_analyze)\n or an info dict (usually opened using read_trans()).\n\nCallgraph: \t[_add_exg->[_log_ch,_check_head_pos],simulate_raw->[_log_ch,_check_stc_iterable,_check_head_pos],add_chpi->[_log_ch,_check_head_pos]]\nCodereview: ", "role": "user" }, { "content": "the stc param type description should be changed accordingly. So far it just says: `stc : iterable | SourceEstimate` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -413,6 +413,11 @@ AVAILABLE_CLI_OPTIONS = {\n metavar='INT',\n default=750,\n ),\n+ \"skip_trades\": Arg(\n+ '--skip-trades',\n+ help='Skip using trades file from backtesting and DB.',\n+ action='store_true',\n+ ),\n \"trade_source\": Arg(\n '--trade-source',\n help='Specify the source for trades (Can be DB or file (backtest file)) '\n\nCallgraph: \t[check_int_nonzero->[ArgumentTypeError,int],check_int_positive->[ArgumentTypeError,int],Arg]\nCodereview: ", "role": "user" }, { "content": "Personally, i would prefer to use `--no-trades`. While technically the trades loading is skipped, no-trades seems more intuitive to me - but it's a personal preference - so if you prefer skip-trades that's fine, too </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -921,6 +921,15 @@ def _plugins_parsing(helpful, plugins):\n \"plugins\", \"--configurator\", help=\"Name of the plugin that is \"\n \"both an authenticator and an installer. Should not be used \"\n \"together with --authenticator or --installer.\")\n+ helpful.add(\"plugins\", \"--apache\", action=\"store_true\",\n+ help=\"Obtain and install certs using Apache\")\n+ helpful.add(\"plugins\", \"--nginx\", action=\"store_true\",\n+ help=\"Obtain and install certs using Nginx\")\n+ helpful.add(\"plugins\", \"--standalone\", action=\"store_true\",\n+ help=('Obtain certs using a \"standalone\" webserver. '\n+ 'Changes the default \"run\" command to \"auth\".'))\n+\n+\n \n # things should not be reorder past/pre this comment:\n # plugins_group should be displayed in --help before plugin\n\nCallgraph: \t[_plugins_parsing->[add,add_group,add_plugin_args],_auth_from_domains->[_report_new_cert,_treat_as_renewal],revoke->[revoke,_determine_account],auth->[_auth_from_domains,_find_domains,_report_new_cert,choose_configurator_plugins,_init_le_client],_create_subparsers->[add_subparser,add,add_group,flag_default],setup_logging->[setup_log_file_handler],_treat_as_renewal->[_find_duplicative_certs],SilentParser->[add_argument->[add_argument]],HelpfulArgumentParser->[add_plugin_args->[add_group],add->[add_argument],__init__->[SilentParser,flag_default]],install->[_init_le_client,_find_domains,choose_configurator_plugins],run->[_init_le_client,_auth_from_domains,_find_domains,choose_configurator_plugins],create_parser->[HelpfulArgumentParser,flag_default,add,config_help,add_group],main->[setup_logging,create_parser],choose_configurator_plugins->[set_configurator,diagnose_configurator_problem],_paths_parser->[config_help,add,add_group,flag_default],_init_le_client->[_determine_account],rollback->[rollback],main]\nCodereview: ", "role": "user" }, { "content": "Help still needs to be updated. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -53,8 +53,8 @@ class KeyClient(AsyncKeyVaultClientBase):\n :param str name: The name of the new key.\n :param key_type: The type of key to create\n :type key_type: ~azure.keyvault.keys.KeyType or str\n- :keyword int size: RSA key size in bits, for example 2048, 3072, or 4096. Applies only to RSA keys. To\n- create an RSA key, consider using :func:`create_rsa_key` instead.\n+ :keyword int size: RSA key size in bits, for example 2048, 3072, or 4096. Applies only to RSA and octet sequence\n+ keys. Consider using :func:`create_rsa_key` or :func:`create_oct_key` instead.\n :keyword curve: Elliptic curve name. Applies only to elliptic curve keys. Defaults to the NIST P-256\n elliptic curve. To create an elliptic curve key, consider using :func:`create_ec_key` instead.\n :paramtype curve: ~azure.keyvault.keys.KeyCurveName or str\n\nCallgraph: \t[KeyClient->[get_key->[get_key],recover_deleted_key->[recover_deleted_key],create_ec_key->[create_key],delete_key->[delete_key],get_deleted_key->[get_deleted_key],purge_deleted_key->[purge_deleted_key],backup_key->[backup_key],create_rsa_key->[create_key],import_key->[import_key],create_key->[create_key]]]\nCodereview: ", "role": "user" }, { "content": "This is no longer *RSA* key size and if we list example sizes here, we must distinguish between symmetric and RSA key sizes. Also, I lean toward \"symmetric\" over \"octet sequence\" because it's more common. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -273,6 +273,11 @@ AVAILABLE_CLI_OPTIONS = {\n type=check_int_positive,\n metavar='INT',\n ),\n+ \"download_trades\": Arg(\n+ '--dl-trades',\n+ help='Download trades instead of OHLCV data.',\n+ action='store_true',\n+ ),\n \"exchange\": Arg(\n '--exchange',\n help=f'Exchange name (default: `{constants.DEFAULT_EXCHANGE}`). '\n\nCallgraph: \t[check_int_positive->[ArgumentTypeError,int],Arg,join]\nCodereview: ", "role": "user" }, { "content": "\"Download trades instead of OHLCV data. The bot will resample trades to the desired timeframe. (target timeframe, goal timeframe, timeframe specified)\" </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -273,6 +273,11 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n \"consider using the list, dict or set constructor. \"\n \"It is faster and simpler.\",\n ),\n+ \"R1722\": (\n+ \"Consider using sys.exit()\",\n+ \"consider-using-sys-exit\",\n+ \"Instead of using exit() or quit(), consider using the sys.exit().\",\n+ ),\n }\n options = (\n (\nCallgraph: \t[RefactoringChecker->[_check_superfluous_else_raise->[_check_superfluous_else],process_tokens->[_is_trailing_comma],_check_nested_blocks->[_is_actual_elif],_check_chained_comparison->[_find_lower_upper_bounds],visit_with->[_check_redefined_argument_from_local],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_if->[_check_superfluous_else_raise,_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_assign->[_check_swap_variables],_check_superfluous_else->[_is_actual_elif,_if_statement_is_always_returning],visit_excepthandler->[_check_redefined_argument_from_local],leave_module->[_init],visit_augassign->[_check_consider_using_join],visit_for->[_check_redefined_argument_from_local],_is_node_return_ended->[_is_node_return_ended],visit_boolop->[_check_chained_comparison,_check_consider_using_in,_check_consider_merging_isinstance],visit_call->[_check_consider_using_comprehension_constructor],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],_check_superfluous_else_return->[_check_superfluous_else],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],_check_consider_get->[type_and_name_are_equal]],RecommandationChecker->[visit_for->[_is_constant_zero,_is_builtin]],_is_trailing_comma->[get_curline_index_start],LenChecker->[visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -149,7 +149,8 @@ def simulate_raw(info, stc=None, trans=None, src=None, bem=None, head_pos=None,\n See Notes for details.\n \n .. versionchanged:: 0.18\n- Support for tuple, and iterable of tuple or SourceEstimate.\n+ Support for tuple, iterable of tuple or SourceEstimate,\n+ or SourceSimulator.\n trans : dict | str | None\n Either a transformation filename (usually made using mne_analyze)\n or an info dict (usually opened using read_trans()).\n\nCallgraph: \t[_add_exg->[_log_ch,_check_head_pos],simulate_raw->[_log_ch,_check_stc_iterable,_check_head_pos],add_chpi->[_log_ch,_check_head_pos]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nthe stc param type description should be changed accordingly. So far it just says: `stc : iterable | SourceEstimate` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -413,6 +413,11 @@ AVAILABLE_CLI_OPTIONS = {\n metavar='INT',\n default=750,\n ),\n+ \"skip_trades\": Arg(\n+ '--skip-trades',\n+ help='Skip using trades file from backtesting and DB.',\n+ action='store_true',\n+ ),\n \"trade_source\": Arg(\n '--trade-source',\n help='Specify the source for trades (Can be DB or file (backtest file)) '\n\nCallgraph: \t[check_int_nonzero->[ArgumentTypeError,int],check_int_positive->[ArgumentTypeError,int],Arg]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nPersonally, i would prefer to use `--no-trades`. While technically the trades loading is skipped, no-trades seems more intuitive to me - but it's a personal preference - so if you prefer skip-trades that's fine, too </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -921,6 +921,15 @@ def _plugins_parsing(helpful, plugins):\n \"plugins\", \"--configurator\", help=\"Name of the plugin that is \"\n \"both an authenticator and an installer. Should not be used \"\n \"together with --authenticator or --installer.\")\n+ helpful.add(\"plugins\", \"--apache\", action=\"store_true\",\n+ help=\"Obtain and install certs using Apache\")\n+ helpful.add(\"plugins\", \"--nginx\", action=\"store_true\",\n+ help=\"Obtain and install certs using Nginx\")\n+ helpful.add(\"plugins\", \"--standalone\", action=\"store_true\",\n+ help=('Obtain certs using a \"standalone\" webserver. '\n+ 'Changes the default \"run\" command to \"auth\".'))\n+\n+\n \n # things should not be reorder past/pre this comment:\n # plugins_group should be displayed in --help before plugin\n\nCallgraph: \t[_plugins_parsing->[add,add_group,add_plugin_args],_auth_from_domains->[_report_new_cert,_treat_as_renewal],revoke->[revoke,_determine_account],auth->[_auth_from_domains,_find_domains,_report_new_cert,choose_configurator_plugins,_init_le_client],_create_subparsers->[add_subparser,add,add_group,flag_default],setup_logging->[setup_log_file_handler],_treat_as_renewal->[_find_duplicative_certs],SilentParser->[add_argument->[add_argument]],HelpfulArgumentParser->[add_plugin_args->[add_group],add->[add_argument],__init__->[SilentParser,flag_default]],install->[_init_le_client,_find_domains,choose_configurator_plugins],run->[_init_le_client,_auth_from_domains,_find_domains,choose_configurator_plugins],create_parser->[HelpfulArgumentParser,flag_default,add,config_help,add_group],main->[setup_logging,create_parser],choose_configurator_plugins->[set_configurator,diagnose_configurator_problem],_paths_parser->[config_help,add,add_group,flag_default],_init_le_client->[_determine_account],rollback->[rollback],main]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nHelp still needs to be updated. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -53,8 +53,8 @@ class KeyClient(AsyncKeyVaultClientBase):\n :param str name: The name of the new key.\n :param key_type: The type of key to create\n :type key_type: ~azure.keyvault.keys.KeyType or str\n- :keyword int size: RSA key size in bits, for example 2048, 3072, or 4096. Applies only to RSA keys. To\n- create an RSA key, consider using :func:`create_rsa_key` instead.\n+ :keyword int size: RSA key size in bits, for example 2048, 3072, or 4096. Applies only to RSA and octet sequence\n+ keys. Consider using :func:`create_rsa_key` or :func:`create_oct_key` instead.\n :keyword curve: Elliptic curve name. Applies only to elliptic curve keys. Defaults to the NIST P-256\n elliptic curve. To create an elliptic curve key, consider using :func:`create_ec_key` instead.\n :paramtype curve: ~azure.keyvault.keys.KeyCurveName or str\n\nCallgraph: \t[KeyClient->[get_key->[get_key],recover_deleted_key->[recover_deleted_key],create_ec_key->[create_key],delete_key->[delete_key],get_deleted_key->[get_deleted_key],purge_deleted_key->[purge_deleted_key],backup_key->[backup_key],create_rsa_key->[create_key],import_key->[import_key],create_key->[create_key]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThis is no longer *RSA* key size and if we list example sizes here, we must distinguish between symmetric and RSA key sizes. Also, I lean toward \"symmetric\" over \"octet sequence\" because it's more common. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -273,6 +273,11 @@ AVAILABLE_CLI_OPTIONS = {\n type=check_int_positive,\n metavar='INT',\n ),\n+ \"download_trades\": Arg(\n+ '--dl-trades',\n+ help='Download trades instead of OHLCV data.',\n+ action='store_true',\n+ ),\n \"exchange\": Arg(\n '--exchange',\n help=f'Exchange name (default: `{constants.DEFAULT_EXCHANGE}`). '\n\nCallgraph: \t[check_int_positive->[ArgumentTypeError,int],Arg,join]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\n\"Download trades instead of OHLCV data. The bot will resample trades to the desired timeframe. (target timeframe, goal timeframe, timeframe specified)\" </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -273,6 +273,11 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n \"consider using the list, dict or set constructor. \"\n \"It is faster and simpler.\",\n ),\n+ \"R1722\": (\n+ \"Consider using sys.exit()\",\n+ \"consider-using-sys-exit\",\n+ \"Instead of using exit() or quit(), consider using the sys.exit().\",\n+ ),\n }\n options = (\n (\nCallgraph: \t[RefactoringChecker->[_check_superfluous_else_raise->[_check_superfluous_else],process_tokens->[_is_trailing_comma],_check_nested_blocks->[_is_actual_elif],_check_chained_comparison->[_find_lower_upper_bounds],visit_with->[_check_redefined_argument_from_local],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_if->[_check_superfluous_else_raise,_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_assign->[_check_swap_variables],_check_superfluous_else->[_is_actual_elif,_if_statement_is_always_returning],visit_excepthandler->[_check_redefined_argument_from_local],leave_module->[_init],visit_augassign->[_check_consider_using_join],visit_for->[_check_redefined_argument_from_local],_is_node_return_ended->[_is_node_return_ended],visit_boolop->[_check_chained_comparison,_check_consider_using_in,_check_consider_merging_isinstance],visit_call->[_check_consider_using_comprehension_constructor],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],_check_superfluous_else_return->[_check_superfluous_else],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],_check_consider_get->[type_and_name_are_equal]],RecommandationChecker->[visit_for->[_is_constant_zero,_is_builtin]],_is_trailing_comma->[get_curline_index_start],LenChecker->[visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]\nCodereview: ", "role": "user" } ]
9ef6bf7111827712
{ "callgraph": "[cleanExpiredHosts->[val,asyncMultiPut,begin,emplace_back,valid,find,size,CHECK_EQ,LOG,end,erase,empty,key,prefix,next],getActiveHosts->[begin,end,size,resize],loadHostMap->[val,valid,LOG,updateHostInfo,key,prefix,next],intervalSeconds_->[CHECK_GT,CHECK_GE,addTimerTask,CHECK,start],updateHostInfo->[wait,asyncMultiPut,emplace_back,find,isLeader,emplace,end,empty,post]]", "msg": "what to do if some failed? just logging?", "patch": "@@ -146,7 +146,9 @@ void ActiveHostsMan::cleanExpiredHosts() {\n LOG(INFO) << \"set \" << data.size() << \" expired hosts to offline in meta rocksdb\";\n kvstore_->asyncMultiPut(kDefaultSpaceId, kDefaultPartId, std::move(data),\n [] (kvstore::ResultCode code) {\n- CHECK_EQ(code, kvstore::ResultCode::SUCCEEDED);\n+ if (code != kvstore::ResultCode::SUCCEEDED) {\n+ LOG(WARNING) << \"put failed, ret \" << static_cast<int32_t>(code);\n+ }\n });\n }\n }", "summary": "Clean expired hosts. expired hosts to offline in meta rocksdb." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -906,8 +906,8 @@ void attachEvents() {\n for (const auto& subscriber : subscribers) {\n auto status = EventFactory::registerEventSubscriber(subscriber.second);\n if (!status.ok()) {\n- LOG(INFO) << \"Error registering subscriber: \" << subscriber.first << \": \"\n- << status.getMessage();\n+ VLOG(1) << \"Error registering subscriber: \" << subscriber.first << \": \"\n+ << status.getMessage();\n }\n }\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Any particular reason this should stay as an info level log versus something like `LOG(WARNING)`? I think I like the change to `VLOG(1)` also, but it seems to me more consistent with the flow of events if this was a `LOG(WARNING)` as above. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -131,10 +131,9 @@ Status readFile(const fs::path& path,\n auto read_max = static_cast<off_t>(FLAGS_read_max);\n if (file_size > read_max) {\n if (!dry_run) {\n- LOG(WARNING) << \"Cannot read file that exceeds size limit: \"\n- << path.string();\n- VLOG(1) << \"Cannot read \" << path.string()\n- << \" size exceeds limit: \" << file_size << \" > \" << read_max;\n+ return Status::failure(\n+ \"Cannot read \" + path.string() + \" size exceeds limit: \" +\n+ std::to_string(file_size) + \" > \" + std::to_string(read_max));\n }\n return Status::failure(\"File exceeds read limits\");\n }\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "The issue here though is that it's not guaranteed that all the readFile callers will log this error, so we should ensure that they are, to not change the end result. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -62,7 +62,17 @@ void launchQueries(const std::vector<OsqueryScheduledQuery>& queries,\n const int64_t& second) {\n for (const auto& q : queries) {\n if (second % q.interval == 0) {\n- LOG(INFO) << \"Executing query: \" << q.query;\n+ std::string hostIdentifier;\n+ try {\n+ hostIdentifier = getHostIdentifier(FLAGS_host_identifier, DBHandle::getInstance());\n+ }\n+ catch(std::exception& e){\n+ LOG(ERROR) << \"Unable to access hostIdentifier in database: \" << e.what() << \"; Using hostname to \"\n+ \"identify this machine\";\n+ hostIdentifier = osquery::getHostname();\n+ }\n+\n+ LOG(INFO) << hostIdentifier << \" is executing query: \" << q.query;\n int unix_time = std::time(0);\n auto sql = SQL(q.query);\n if (!sql.ok()) {\n\nCallgraph: \t[initializeScheduler->[launchQueries],launchQueries->[getHostIdentifier]]\nCodereview: ", "role": "user" }, { "content": "nit, but can you make this `const std::exception& e`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -623,9 +623,6 @@ Status upgradeDatabase(int to_version) {\n return Status(1, \"Database migration failed.\");\n }\n \n- LOG(INFO) << \"Migration \" << db_version << \" -> \" << (db_version + 1)\n- << \" successfully completed!\";\n-\n db_version++;\n }\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "this status is wrong... should be something like 'DB migration ok, failed to set new version' </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -239,6 +239,13 @@ void SchedulerRunner::start() {\n break;\n }\n }\n+\n+ // Scheduler ended.\n+ if (!interrupted()) {\n+ LOG(INFO) << \"The scheduler ended after \" << FLAGS_schedule_timeout\n+ << \" seconds\";\n+ requestShutdown();\n+ }\n }\n \n std::chrono::milliseconds SchedulerRunner::getCurrentTimeDrift() const\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Why use `FLAGS_schedule_timeout` here? Wouldn't it be better to write out `_timeout` so we know how long it actually ran for, as opposed to the desired timeout? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -146,7 +146,9 @@ void ActiveHostsMan::cleanExpiredHosts() {\n LOG(INFO) << \"set \" << data.size() << \" expired hosts to offline in meta rocksdb\";\n kvstore_->asyncMultiPut(kDefaultSpaceId, kDefaultPartId, std::move(data),\n [] (kvstore::ResultCode code) {\n- CHECK_EQ(code, kvstore::ResultCode::SUCCEEDED);\n+ if (code != kvstore::ResultCode::SUCCEEDED) {\n+ LOG(WARNING) << \"put failed, ret \" << static_cast<int32_t>(code);\n+ }\n });\n }\n }\nCallgraph: \t[cleanExpiredHosts->[val,asyncMultiPut,begin,emplace_back,valid,find,size,CHECK_EQ,LOG,end,erase,empty,key,prefix,next],getActiveHosts->[begin,end,size,resize],loadHostMap->[val,valid,LOG,updateHostInfo,key,prefix,next],intervalSeconds_->[CHECK_GT,CHECK_GE,addTimerTask,CHECK,start],updateHostInfo->[wait,asyncMultiPut,emplace_back,find,isLeader,emplace,end,empty,post]]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -906,8 +906,8 @@ void attachEvents() {\n for (const auto& subscriber : subscribers) {\n auto status = EventFactory::registerEventSubscriber(subscriber.second);\n if (!status.ok()) {\n- LOG(INFO) << \"Error registering subscriber: \" << subscriber.first << \": \"\n- << status.getMessage();\n+ VLOG(1) << \"Error registering subscriber: \" << subscriber.first << \": \"\n+ << status.getMessage();\n }\n }\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nAny particular reason this should stay as an info level log versus something like `LOG(WARNING)`? I think I like the change to `VLOG(1)` also, but it seems to me more consistent with the flow of events if this was a `LOG(WARNING)` as above. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -131,10 +131,9 @@ Status readFile(const fs::path& path,\n auto read_max = static_cast<off_t>(FLAGS_read_max);\n if (file_size > read_max) {\n if (!dry_run) {\n- LOG(WARNING) << \"Cannot read file that exceeds size limit: \"\n- << path.string();\n- VLOG(1) << \"Cannot read \" << path.string()\n- << \" size exceeds limit: \" << file_size << \" > \" << read_max;\n+ return Status::failure(\n+ \"Cannot read \" + path.string() + \" size exceeds limit: \" +\n+ std::to_string(file_size) + \" > \" + std::to_string(read_max));\n }\n return Status::failure(\"File exceeds read limits\");\n }\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThe issue here though is that it's not guaranteed that all the readFile callers will log this error, so we should ensure that they are, to not change the end result. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -62,7 +62,17 @@ void launchQueries(const std::vector<OsqueryScheduledQuery>& queries,\n const int64_t& second) {\n for (const auto& q : queries) {\n if (second % q.interval == 0) {\n- LOG(INFO) << \"Executing query: \" << q.query;\n+ std::string hostIdentifier;\n+ try {\n+ hostIdentifier = getHostIdentifier(FLAGS_host_identifier, DBHandle::getInstance());\n+ }\n+ catch(std::exception& e){\n+ LOG(ERROR) << \"Unable to access hostIdentifier in database: \" << e.what() << \"; Using hostname to \"\n+ \"identify this machine\";\n+ hostIdentifier = osquery::getHostname();\n+ }\n+\n+ LOG(INFO) << hostIdentifier << \" is executing query: \" << q.query;\n int unix_time = std::time(0);\n auto sql = SQL(q.query);\n if (!sql.ok()) {\n\nCallgraph: \t[initializeScheduler->[launchQueries],launchQueries->[getHostIdentifier]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nnit, but can you make this `const std::exception& e`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -623,9 +623,6 @@ Status upgradeDatabase(int to_version) {\n return Status(1, \"Database migration failed.\");\n }\n \n- LOG(INFO) << \"Migration \" << db_version << \" -> \" << (db_version + 1)\n- << \" successfully completed!\";\n-\n db_version++;\n }\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nthis status is wrong... should be something like 'DB migration ok, failed to set new version' </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -239,6 +239,13 @@ void SchedulerRunner::start() {\n break;\n }\n }\n+\n+ // Scheduler ended.\n+ if (!interrupted()) {\n+ LOG(INFO) << \"The scheduler ended after \" << FLAGS_schedule_timeout\n+ << \" seconds\";\n+ requestShutdown();\n+ }\n }\n \n std::chrono::milliseconds SchedulerRunner::getCurrentTimeDrift() const\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWhy use `FLAGS_schedule_timeout` here? Wouldn't it be better to write out `_timeout` so we know how long it actually ran for, as opposed to the desired timeout? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -146,7 +146,9 @@ void ActiveHostsMan::cleanExpiredHosts() {\n LOG(INFO) << \"set \" << data.size() << \" expired hosts to offline in meta rocksdb\";\n kvstore_->asyncMultiPut(kDefaultSpaceId, kDefaultPartId, std::move(data),\n [] (kvstore::ResultCode code) {\n- CHECK_EQ(code, kvstore::ResultCode::SUCCEEDED);\n+ if (code != kvstore::ResultCode::SUCCEEDED) {\n+ LOG(WARNING) << \"put failed, ret \" << static_cast<int32_t>(code);\n+ }\n });\n }\n }\nCallgraph: \t[cleanExpiredHosts->[val,asyncMultiPut,begin,emplace_back,valid,find,size,CHECK_EQ,LOG,end,erase,empty,key,prefix,next],getActiveHosts->[begin,end,size,resize],loadHostMap->[val,valid,LOG,updateHostInfo,key,prefix,next],intervalSeconds_->[CHECK_GT,CHECK_GE,addTimerTask,CHECK,start],updateHostInfo->[wait,asyncMultiPut,emplace_back,find,isLeader,emplace,end,empty,post]]\nCodereview: ", "role": "user" } ]
227dc48253ec11e5
{ "callgraph": "[Error->[Error],Shutdown->[Wait,add,recoveryHandleCleanup,Close,hasErrors,Errorf,Shutdown,Go,p2pCancel],NewTracer,Start,Sleep,SetAddPeersHandler,Init,Int64,WithConnectionConfigs,Join,NewFixedPricer,SetPaymentThresholdObserver,EthereumAddress,WriterLevel,Background,NewChequeStore,NewStateStore,HexToAddress,NewCashoutService,Debugf,Bytes,SetSwap,SetPushSyncer,Warningf,Addresses,AddProtocol,Register,NewMultiResolver,NewFactory,IsHexAddress,SetNotifyPaymentFunc,Protocol,WithLogger,Metrics,NewRepairHandler,MustRegisterMetrics,After,Ready,Dial,NATManager,Serve,NewService,Debug,New,SetNotifier,DiscoverFactoryAddress,NewAccounting,NewChequeSigner,NewAddressbook,NewTags,Info,Warning,Infof,WithCancel,NewMultiaddr,NewCallback,Addr,Error,ChainID,Errorf,Listen]", "msg": "It provides a type called Node which is a fully functional bee client. This package is where the dependencies are injected. It is not just a glue-code, it is concept of node.", "patch": "@@ -2,6 +2,8 @@\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n \n+// Package node provides the glue-code needed in order\n+// to start a Bee node.\n package node\n \n import (", "summary": "License for the BSD - style license of the source code. Package hierarchy for all packages." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -2,6 +2,10 @@\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n+// Copyright 2018 The Gitea Authors. All rights reserved.\n+// Use of this source code is governed by a MIT-style\n+// license that can be found in the LICENSE file.\n+\n package repo\n \n import (\n\nCallgraph: \t[Status,GetIssueByIndex,IsPoster,IsWriter,UpdateIssue,Error,IsErrIssueNotExist,ChangeStatus,UpdateIssueUserByAssignee,ChangeMilestoneAssign,JSON,ParamsInt64,StateType,ToLower,IsErrUserNotExist,GetUserByName,Query,APIFormat,Sprintf,SetLinkHeader,NewIssue,GetIssueByID,QueryInt,Issues]\nCodereview: ", "role": "user" }, { "content": "This is not required </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,10 +1,12 @@\n // Copyright 2014 The Gogs Authors. All rights reserved.\n+// Copyright 2019 The Gogs Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n package context\n \n import (\n+\t\"code.gitea.io/gitea/models\"\n \t\"code.gitea.io/gitea/modules/auth\"\n \t\"code.gitea.io/gitea/modules/log\"\n \t\"code.gitea.io/gitea/modules/setting\"\n\nCallgraph: \t[Tr,Redirect,HTML,IsAPIPath,Written,Error,RemoteAddr,Validate,SetCookie,GetCookie,JSON,Info]\nCodereview: ", "role": "user" }, { "content": "Gitea, not Gogs. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,4 +1,5 @@\n // Copyright 2016 The Gogs Authors. All rights reserved.\n+// Copyright 2016 The Gitea Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n\nCallgraph: \t[Printf,SetEngine,Bool,CreateUser,String,Errorf,LoadConfigs,IsSet,NewContext]\nCodereview: ", "role": "user" }, { "content": "Please send this line top on the Gogs </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,10 +1,15 @@\n // Copyright 2015 The Gogs Authors. All rights reserved.\n+// Copyright 2019 The Gitea Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n package models\n \n-import \"fmt\"\n+import (\n+\t\"fmt\"\n+\n+\t\"code.gitea.io/gitea/modules/git\"\n+)\n \n // ErrNameReserved represents a \"reserved name\" error.\n type ErrNameReserved struct {\n\nCallgraph: \t[Error->[Sprintf,Error]]\nCodereview: ", "role": "user" }, { "content": "This isn't your fault - but this file is insanely long now. It needs splitting - but that can be done in different PR. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,4 +1,4 @@\n-// Copyright 2014 The Gogs Authors. All rights reserved.\n+// Copyright 2017 Gitea. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n\nCallgraph: \t[EventsArray->[HasPushEvent,HasCreateEvent,HasPullRequestEvent],deliver,HasPushEvent,HasCreateEvent,HasPullRequestEvent]\nCodereview: ", "role": "user" }, { "content": "Hm, you can add a line. But the copyright to the old stuff cannot be removed, FMPOV. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -2,6 +2,8 @@\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n \n+// Package node provides the glue-code needed in order\n+// to start a Bee node.\n package node\n \n import (\nCallgraph: \t[Error->[Error],Shutdown->[Wait,add,recoveryHandleCleanup,Close,hasErrors,Errorf,Shutdown,Go,p2pCancel],NewTracer,Start,Sleep,SetAddPeersHandler,Init,Int64,WithConnectionConfigs,Join,NewFixedPricer,SetPaymentThresholdObserver,EthereumAddress,WriterLevel,Background,NewChequeStore,NewStateStore,HexToAddress,NewCashoutService,Debugf,Bytes,SetSwap,SetPushSyncer,Warningf,Addresses,AddProtocol,Register,NewMultiResolver,NewFactory,IsHexAddress,SetNotifyPaymentFunc,Protocol,WithLogger,Metrics,NewRepairHandler,MustRegisterMetrics,After,Ready,Dial,NATManager,Serve,NewService,Debug,New,SetNotifier,DiscoverFactoryAddress,NewAccounting,NewChequeSigner,NewAddressbook,NewTags,Info,Warning,Infof,WithCancel,NewMultiaddr,NewCallback,Addr,Error,ChainID,Errorf,Listen]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -2,6 +2,10 @@\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n+// Copyright 2018 The Gitea Authors. All rights reserved.\n+// Use of this source code is governed by a MIT-style\n+// license that can be found in the LICENSE file.\n+\n package repo\n \n import (\n\nCallgraph: \t[Status,GetIssueByIndex,IsPoster,IsWriter,UpdateIssue,Error,IsErrIssueNotExist,ChangeStatus,UpdateIssueUserByAssignee,ChangeMilestoneAssign,JSON,ParamsInt64,StateType,ToLower,IsErrUserNotExist,GetUserByName,Query,APIFormat,Sprintf,SetLinkHeader,NewIssue,GetIssueByID,QueryInt,Issues]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThis is not required </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,10 +1,12 @@\n // Copyright 2014 The Gogs Authors. All rights reserved.\n+// Copyright 2019 The Gogs Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n package context\n \n import (\n+\t\"code.gitea.io/gitea/models\"\n \t\"code.gitea.io/gitea/modules/auth\"\n \t\"code.gitea.io/gitea/modules/log\"\n \t\"code.gitea.io/gitea/modules/setting\"\n\nCallgraph: \t[Tr,Redirect,HTML,IsAPIPath,Written,Error,RemoteAddr,Validate,SetCookie,GetCookie,JSON,Info]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nGitea, not Gogs. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,4 +1,5 @@\n // Copyright 2016 The Gogs Authors. All rights reserved.\n+// Copyright 2016 The Gitea Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n\nCallgraph: \t[Printf,SetEngine,Bool,CreateUser,String,Errorf,LoadConfigs,IsSet,NewContext]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nPlease send this line top on the Gogs </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,10 +1,15 @@\n // Copyright 2015 The Gogs Authors. All rights reserved.\n+// Copyright 2019 The Gitea Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n package models\n \n-import \"fmt\"\n+import (\n+\t\"fmt\"\n+\n+\t\"code.gitea.io/gitea/modules/git\"\n+)\n \n // ErrNameReserved represents a \"reserved name\" error.\n type ErrNameReserved struct {\n\nCallgraph: \t[Error->[Sprintf,Error]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThis isn't your fault - but this file is insanely long now. It needs splitting - but that can be done in different PR. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,4 +1,4 @@\n-// Copyright 2014 The Gogs Authors. All rights reserved.\n+// Copyright 2017 Gitea. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n\nCallgraph: \t[EventsArray->[HasPushEvent,HasCreateEvent,HasPullRequestEvent],deliver,HasPushEvent,HasCreateEvent,HasPullRequestEvent]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nHm, you can add a line. But the copyright to the old stuff cannot be removed, FMPOV. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -2,6 +2,8 @@\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n \n+// Package node provides the glue-code needed in order\n+// to start a Bee node.\n package node\n \n import (\nCallgraph: \t[Error->[Error],Shutdown->[Wait,add,recoveryHandleCleanup,Close,hasErrors,Errorf,Shutdown,Go,p2pCancel],NewTracer,Start,Sleep,SetAddPeersHandler,Init,Int64,WithConnectionConfigs,Join,NewFixedPricer,SetPaymentThresholdObserver,EthereumAddress,WriterLevel,Background,NewChequeStore,NewStateStore,HexToAddress,NewCashoutService,Debugf,Bytes,SetSwap,SetPushSyncer,Warningf,Addresses,AddProtocol,Register,NewMultiResolver,NewFactory,IsHexAddress,SetNotifyPaymentFunc,Protocol,WithLogger,Metrics,NewRepairHandler,MustRegisterMetrics,After,Ready,Dial,NATManager,Serve,NewService,Debug,New,SetNotifier,DiscoverFactoryAddress,NewAccounting,NewChequeSigner,NewAddressbook,NewTags,Info,Warning,Infof,WithCancel,NewMultiaddr,NewCallback,Addr,Error,ChainID,Errorf,Listen]\nCodereview: ", "role": "user" } ]
24d018dc07d55e7c
{ "callgraph": "[EthGetCode->[getName->[getMethodName],blockParameterOrBlockHash->[getRequiredParameter],resultByBlockHash->[toHexString,isPresent,getPrivateWorldStateAtBlock,getRequiredParameter,orElse,get,getBlockHeaderByHash,getGoQuorumPrivacyParameters]]]", "msg": "Same here, can we presume if `privacyParameters` is set we need goQuorum handling? Or is there a goQuorum sub option in `privacyParametes`?", "patch": "@@ -64,7 +64,8 @@ public class EthGetCode extends AbstractBlockParameterOrBlockHashMethod {\n @Override\n protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {\n final Address address = request.getRequiredParameter(0, Address.class);\n- if (GoQuorumOptions.goQuorumCompatibilityMode && privacyParameters.isPresent()) {\n+ final boolean isGoQuorumCompatibilityMode = GoQuorumOptions.goQuorumCompatibilityMode;\n+ if (isGoQuorumCompatibilityMode && privacyParameters.isPresent()) {\n // get from private state if we can\n final Optional<BlockHeader> blockHeader =\n blockchainQueries.get().getBlockHeaderByHash(blockHash);", "summary": "Get the code associated with a block." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -42,14 +42,14 @@ import org.infinispan.remoting.transport.Address;\n * @author wburns\n * @since 9.3\n */\n-@Listener\n public class DefaultSegmentedDataContainer<K, V> extends AbstractInternalDataContainer<K, V> {\n \n private static final Log log = LogFactory.getLog(MethodHandles.lookup().lookupClass());\n private static final boolean trace = log.isTraceEnabled();\n \n- public final AtomicReferenceArray<ConcurrentMap<K, InternalCacheEntry<K, V>>> maps;\n- protected Address localNode;\n+ protected final AtomicReferenceArray<ConcurrentMap<K, InternalCacheEntry<K, V>>> maps;\n+ protected boolean shouldStopSegments;\n+\n \n public DefaultSegmentedDataContainer(int numSegments) {\n maps = new AtomicReferenceArray<>(numSegments);\n\nCallgraph: \t[DefaultSegmentedDataContainer->[removeSegments->[forEach],forEachIncludingExpired->[forEach],forEach->[forEach],keySet->[size->[size],spliterator->[spliterator],iterator->[iteratorIncludingExpired]],sizeIncludingExpired->[iterator],clear->[clear],addSegments->[forEach]]]\nCodereview: ", "role": "user" }, { "content": "What are we removing this? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -226,10 +226,8 @@ public class DiceServerEditor extends JPanel {\n public boolean areFieldsValid() {\n final boolean toValid =\n !toAddress.getText().isEmpty() && PlayerEmailValidation.isValid(toAddress.getText());\n- SwingComponents.highlightLabelIfNotValid(toValid, toLabel);\n final boolean ccValid =\n !ccAddress.getText().isEmpty() && PlayerEmailValidation.isValid(ccAddress.getText());\n- SwingComponents.highlightLabelIfNotValid(ccValid, ccLabel);\n \n final boolean allValid = toValid && ccValid;\n testDiceButton.setEnabled(allValid);\n\nCallgraph: \t[DiceServerEditor->[areFieldsValid->[isValid,setToolTipText,isEmpty,getText,setEnabled,highlightLabelIfNotValid],applyToGameProperties->[getText,set],newDiceServer->[build],checkFieldsAndNotify->[areFieldsValid,run],populateFromGameProperties->[setText,get],GridBagConstraints,create,equals,newDiceServer,toString,test,setLayout,GridBagLayout,PbemDiceRoller,JTextField,JButton,addActionListener,orElseThrow,TitledBorder,build,JPanel,setBorder,attachDocumentListener,JLabel,add,Insets]]\nCodereview: ", "role": "user" }, { "content": "In theory the enabled button stuff should be performed on the event queue as well, but swing doesn't really care. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -71,7 +71,14 @@ public final class OAuth20ProfileController extends AbstractController {\n protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)\n throws Exception {\n \n- final String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ if (StringUtils.isBlank(accessToken)) {\n+ // try getting the bearer token from the authorization header\n+ final String authHeader = request.getHeader(\"Authorization\");\n+ if (authHeader != null && authHeader.startsWith(\"bearer \")) {\n+ accessToken = authHeader.substring(7);\n+ }\n+ }\n LOGGER.debug(\"{} : {}\", OAuthConstants.ACCESS_TOKEN, accessToken);\n \n final JsonGenerator jsonGenerator = this.jsonFactory.createJsonGenerator(response.getWriter());\n\nCallgraph: \t[OAuth20ProfileController->[handleRequestInternal->[isExpired,writeEndObject,getPrincipal,writeArrayFieldStart,isBlank,writeStringField,setContentType,writeObjectField,createJsonGenerator,debug,error,getWriter,writeEndArray,flushBuffer,getTicket,get,closeQuietly,writeStartObject,getParameter,getId,getAttributes,keySet],JsonFactory,getLogger,ObjectMapper]]\nCodereview: ", "role": "user" }, { "content": "This should also be StringUtils.isNotBlank </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -71,7 +71,13 @@ public final class OAuth20ProfileController extends AbstractController {\n protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)\n throws Exception {\n \n- final String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ if (StringUtils.isBlank(accessToken)) {\n+ final String authHeader = request.getHeader(\"Authorization\");\n+ if (StringUtils.isNotBlank(accessToken) && authHeader.startsWith(\"bearer \")) {\n+ accessToken = authHeader.substring(7);\n+ }\n+ }\n LOGGER.debug(\"{} : {}\", OAuthConstants.ACCESS_TOKEN, accessToken);\n \n final JsonGenerator jsonGenerator = this.jsonFactory.createJsonGenerator(response.getWriter());\n\nCallgraph: \t[OAuth20ProfileController->[handleRequestInternal->[isExpired,writeEndObject,getPrincipal,writeArrayFieldStart,isBlank,writeStringField,setContentType,writeObjectField,createJsonGenerator,debug,error,getWriter,writeEndArray,flushBuffer,getTicket,get,closeQuietly,writeStartObject,getParameter,getId,getAttributes,keySet],JsonFactory,getLogger,ObjectMapper]]\nCodereview: ", "role": "user" }, { "content": "This String probably should be moved over to `OAuthConstants`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -161,9 +161,9 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet\n final String defaultHost = hostFinder.getDefaultHost();\n request.setAttribute(HOST_ATTRIBUTE, defaultHost);\n \n- final boolean isQueryEndpoint = request.getRequestURI().startsWith(\"/druid/v2\");\n+ final String requestURI = request.getRequestURI();\n \n- if (isQueryEndpoint && HttpMethod.DELETE.is(request.getMethod())) {\n+ if (requestURI.startsWith(QUERY_URL_V2) && HttpMethod.DELETE.is(request.getMethod())) {\n // query cancellation request\n for (final String host : hostFinder.getAllHosts()) {\n // send query cancellation to all brokers this query may have gone to\n\nCallgraph: \t[AsyncQueryForwardingServlet->[destroy->[destroy],service->[handleException,service],init->[init],rewriteURI->[rewriteURI],MetricsEmittingProxyResponseListener->[onComplete->[onComplete],onFailure->[onFailure]],createHttpClient->[createHttpClient],newProxyResponseListener->[newProxyResponseListener]]]\nCodereview: ", "role": "user" }, { "content": "This kind of logic strikes me as something that should be able to be handled at a more abstract routing level. Have you had a chance to look for such items? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -64,7 +64,8 @@ public class EthGetCode extends AbstractBlockParameterOrBlockHashMethod {\n @Override\n protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {\n final Address address = request.getRequiredParameter(0, Address.class);\n- if (GoQuorumOptions.goQuorumCompatibilityMode && privacyParameters.isPresent()) {\n+ final boolean isGoQuorumCompatibilityMode = GoQuorumOptions.goQuorumCompatibilityMode;\n+ if (isGoQuorumCompatibilityMode && privacyParameters.isPresent()) {\n // get from private state if we can\n final Optional<BlockHeader> blockHeader =\n blockchainQueries.get().getBlockHeaderByHash(blockHash);\nCallgraph: \t[EthGetCode->[getName->[getMethodName],blockParameterOrBlockHash->[getRequiredParameter],resultByBlockHash->[toHexString,isPresent,getPrivateWorldStateAtBlock,getRequiredParameter,orElse,get,getBlockHeaderByHash,getGoQuorumPrivacyParameters]]]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -42,14 +42,14 @@ import org.infinispan.remoting.transport.Address;\n * @author wburns\n * @since 9.3\n */\n-@Listener\n public class DefaultSegmentedDataContainer<K, V> extends AbstractInternalDataContainer<K, V> {\n \n private static final Log log = LogFactory.getLog(MethodHandles.lookup().lookupClass());\n private static final boolean trace = log.isTraceEnabled();\n \n- public final AtomicReferenceArray<ConcurrentMap<K, InternalCacheEntry<K, V>>> maps;\n- protected Address localNode;\n+ protected final AtomicReferenceArray<ConcurrentMap<K, InternalCacheEntry<K, V>>> maps;\n+ protected boolean shouldStopSegments;\n+\n \n public DefaultSegmentedDataContainer(int numSegments) {\n maps = new AtomicReferenceArray<>(numSegments);\n\nCallgraph: \t[DefaultSegmentedDataContainer->[removeSegments->[forEach],forEachIncludingExpired->[forEach],forEach->[forEach],keySet->[size->[size],spliterator->[spliterator],iterator->[iteratorIncludingExpired]],sizeIncludingExpired->[iterator],clear->[clear],addSegments->[forEach]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWhat are we removing this? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -226,10 +226,8 @@ public class DiceServerEditor extends JPanel {\n public boolean areFieldsValid() {\n final boolean toValid =\n !toAddress.getText().isEmpty() && PlayerEmailValidation.isValid(toAddress.getText());\n- SwingComponents.highlightLabelIfNotValid(toValid, toLabel);\n final boolean ccValid =\n !ccAddress.getText().isEmpty() && PlayerEmailValidation.isValid(ccAddress.getText());\n- SwingComponents.highlightLabelIfNotValid(ccValid, ccLabel);\n \n final boolean allValid = toValid && ccValid;\n testDiceButton.setEnabled(allValid);\n\nCallgraph: \t[DiceServerEditor->[areFieldsValid->[isValid,setToolTipText,isEmpty,getText,setEnabled,highlightLabelIfNotValid],applyToGameProperties->[getText,set],newDiceServer->[build],checkFieldsAndNotify->[areFieldsValid,run],populateFromGameProperties->[setText,get],GridBagConstraints,create,equals,newDiceServer,toString,test,setLayout,GridBagLayout,PbemDiceRoller,JTextField,JButton,addActionListener,orElseThrow,TitledBorder,build,JPanel,setBorder,attachDocumentListener,JLabel,add,Insets]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nIn theory the enabled button stuff should be performed on the event queue as well, but swing doesn't really care. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -71,7 +71,14 @@ public final class OAuth20ProfileController extends AbstractController {\n protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)\n throws Exception {\n \n- final String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ if (StringUtils.isBlank(accessToken)) {\n+ // try getting the bearer token from the authorization header\n+ final String authHeader = request.getHeader(\"Authorization\");\n+ if (authHeader != null && authHeader.startsWith(\"bearer \")) {\n+ accessToken = authHeader.substring(7);\n+ }\n+ }\n LOGGER.debug(\"{} : {}\", OAuthConstants.ACCESS_TOKEN, accessToken);\n \n final JsonGenerator jsonGenerator = this.jsonFactory.createJsonGenerator(response.getWriter());\n\nCallgraph: \t[OAuth20ProfileController->[handleRequestInternal->[isExpired,writeEndObject,getPrincipal,writeArrayFieldStart,isBlank,writeStringField,setContentType,writeObjectField,createJsonGenerator,debug,error,getWriter,writeEndArray,flushBuffer,getTicket,get,closeQuietly,writeStartObject,getParameter,getId,getAttributes,keySet],JsonFactory,getLogger,ObjectMapper]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThis should also be StringUtils.isNotBlank </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -71,7 +71,13 @@ public final class OAuth20ProfileController extends AbstractController {\n protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)\n throws Exception {\n \n- final String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ if (StringUtils.isBlank(accessToken)) {\n+ final String authHeader = request.getHeader(\"Authorization\");\n+ if (StringUtils.isNotBlank(accessToken) && authHeader.startsWith(\"bearer \")) {\n+ accessToken = authHeader.substring(7);\n+ }\n+ }\n LOGGER.debug(\"{} : {}\", OAuthConstants.ACCESS_TOKEN, accessToken);\n \n final JsonGenerator jsonGenerator = this.jsonFactory.createJsonGenerator(response.getWriter());\n\nCallgraph: \t[OAuth20ProfileController->[handleRequestInternal->[isExpired,writeEndObject,getPrincipal,writeArrayFieldStart,isBlank,writeStringField,setContentType,writeObjectField,createJsonGenerator,debug,error,getWriter,writeEndArray,flushBuffer,getTicket,get,closeQuietly,writeStartObject,getParameter,getId,getAttributes,keySet],JsonFactory,getLogger,ObjectMapper]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThis String probably should be moved over to `OAuthConstants`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -161,9 +161,9 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet\n final String defaultHost = hostFinder.getDefaultHost();\n request.setAttribute(HOST_ATTRIBUTE, defaultHost);\n \n- final boolean isQueryEndpoint = request.getRequestURI().startsWith(\"/druid/v2\");\n+ final String requestURI = request.getRequestURI();\n \n- if (isQueryEndpoint && HttpMethod.DELETE.is(request.getMethod())) {\n+ if (requestURI.startsWith(QUERY_URL_V2) && HttpMethod.DELETE.is(request.getMethod())) {\n // query cancellation request\n for (final String host : hostFinder.getAllHosts()) {\n // send query cancellation to all brokers this query may have gone to\n\nCallgraph: \t[AsyncQueryForwardingServlet->[destroy->[destroy],service->[handleException,service],init->[init],rewriteURI->[rewriteURI],MetricsEmittingProxyResponseListener->[onComplete->[onComplete],onFailure->[onFailure]],createHttpClient->[createHttpClient],newProxyResponseListener->[newProxyResponseListener]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nThis kind of logic strikes me as something that should be able to be handled at a more abstract routing level. Have you had a chance to look for such items? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -64,7 +64,8 @@ public class EthGetCode extends AbstractBlockParameterOrBlockHashMethod {\n @Override\n protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {\n final Address address = request.getRequiredParameter(0, Address.class);\n- if (GoQuorumOptions.goQuorumCompatibilityMode && privacyParameters.isPresent()) {\n+ final boolean isGoQuorumCompatibilityMode = GoQuorumOptions.goQuorumCompatibilityMode;\n+ if (isGoQuorumCompatibilityMode && privacyParameters.isPresent()) {\n // get from private state if we can\n final Optional<BlockHeader> blockHeader =\n blockchainQueries.get().getBlockHeaderByHash(blockHash);\nCallgraph: \t[EthGetCode->[getName->[getMethodName],blockParameterOrBlockHash->[getRequiredParameter],resultByBlockHash->[toHexString,isPresent,getPrivateWorldStateAtBlock,getRequiredParameter,orElse,get,getBlockHeaderByHash,getGoQuorumPrivacyParameters]]]\nCodereview: ", "role": "user" } ]
bdc84bf1acc175a6
{ "callgraph": "[MethodNameDeclaration->[getParameterDisplaySignature->[getParameterCount,isVarargs],isVarargs->[isVarargs],toString->[getParameterCount],equals->[getParameterCount,isVarargs,equals],hashCode->[getParameterCount,hashCode],getParameterCount->[getParameterCount]]]", "msg": "In case the method is `void`, there won't be any children and `getChild(0)` throws. We'll need to check with `isVoid()` for that case. I'll update this when I merge.", "patch": "@@ -32,6 +32,11 @@ public class MethodNameDeclaration extends AbstractNameDeclaration {\n return p.isVarargs();\n }\n \n+ public boolean isPrimitiveReturnType() {\n+ return getMethodNameDeclaratorNode().getParent().getResultType().getChild(0)\n+ .getChild(0) instanceof ASTPrimitiveType;\n+ }\n+\n public ASTMethodDeclarator getMethodNameDeclaratorNode() {\n return (ASTMethodDeclarator) node;\n }", "summary": "This method returns true if the node is a varargs or a formal parameter." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -32,6 +32,11 @@ public class DubboInstrumentationModule extends InstrumentationModule {\n return hasClassesNamed(\"org.apache.dubbo.rpc.Filter\");\n }\n \n+ @Override\n+ public boolean isLibraryInstrumentationClass(String className) {\n+ return className.startsWith(\"io.opentelemetry.instrumentation.apachedubbo.v2_7\");\n+ }\n+\n @Override\n public List<TypeInstrumentation> typeInstrumentations() {\n return Collections.singletonList(new DubboInstrumentation());\n\nCallgraph: \t[DubboInstrumentationModule->[typeInstrumentations->[singletonList,DubboInstrumentation],classLoaderMatcher->[hasClassesNamed]]]\nCodereview: ", "role": "user" }, { "content": "Can this be replaced with `this.getClass().getPackage().getName()` and moved to superclass? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -2530,6 +2530,17 @@ public class DoFnSignatures {\n return signatureForDoFn(doFn).usesState() || requiresTimeSortedInput(doFn);\n }\n \n+ private static boolean containsBundleFinalizer(List<Parameter> parameters) {\n+ return parameters.stream().anyMatch(parameter -> parameter instanceof BundleFinalizerParameter);\n+ }\n+\n+ public static boolean usesBundleFinalizer(DoFn<?, ?> doFn) {\n+ DoFnSignature sig = signatureForDoFn(doFn);\n+ return containsBundleFinalizer(sig.startBundle().extraParameters())\n+ || containsBundleFinalizer(sig.finishBundle().extraParameters())\n+ || containsBundleFinalizer(sig.processElement().extraParameters());\n+ }\n+\n public static boolean requiresTimeSortedInput(DoFn<?, ?> doFn) {\n return signatureForDoFn(doFn).processElement().requiresTimeSortedInput();\n }\n\nCallgraph: \t[DoFnSignatures->[getStateSpecOrThrow->[format],analyzeTimerFamilyDeclarations->[create],analyzeProcessElementMethod->[of,getExtraParameters,addParameter,create,setParameter],analyzeStateDeclarations->[of,create,getType],analyzeExtraParameter->[of,getAnnotations,doFnStartBundleContextTypeOf,hasParameter,doFnProcessContextTypeOf,getType,getMethod,doFnOnTimerContextTypeOf,getIndex,doFnFinishBundleContextTypeOf,doFnOnWindowExpirationContextTypeOf,getDeclaringClass],validateTimerField->[getType],ErrorReporter->[forParameter->[ErrorReporter,getIndex,format,getType],forMethod->[ErrorReporter,format],throwIllegalArgument->[format],checkArgument->[throwIllegalArgument],checkNotNull->[throwIllegalArgument],format],MethodAnalysisContext->[create->[MethodAnalysisContext]],parseSignature->[of,getTimerDeclarations,addTimerFamilyDeclarations,getTimerFamilyDeclarations,addStateDeclarations,addFieldAccessDeclarations,create,getStateDeclarations,getFieldAccessDeclarations,addTimerDeclarations],analyzeOnTimerFamilyMethod->[of,create],verifySplittableMethods->[of],analyzeOnWindowExpirationMethod->[of,create],getTimerSpecOrThrow->[format],FnAnalysisContext->[addTimerFamilyDeclarations->[addTimerFamilyDeclaration],addStateDeclarations->[addStateDeclaration],addFieldAccessDeclarations->[addFieldAccessDeclaration],create->[FnAnalysisContext],addTimerDeclarations->[addTimerDeclaration]],analyzeSplitRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],getDeclaringClass->[getDeclaringClass],analyzeOnTimerMethod->[of,create],analyzeGetInitialWatermarkEstimatorStateMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],analyzeNewWatermarkEstimatorMethod->[of,addParameter,getExtraParameters,create,watermarkEstimatorTypeOf,analyzeExtraParameter,getWindowType,checkParameterOneOf],analyzeGetSizeMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],format->[getType],analyzeStartBundleMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],analyzeGetInitialRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],validateTimerFamilyField->[getType],analyzeFieldAccessDeclaration->[create,getType],analyzeNewTrackerMethod->[of,addParameter,getExtraParameters,create,restrictionTrackerTypeOf,getWindowType,analyzeExtraParameter,checkParameterOneOf],analyzeTruncateRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],usesTimers->[usesTimers],analyzeSetupMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],analyzeTimerDeclarations->[create],analyzeFinishBundleMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],usesState->[usesState],analyzeGetWatermarkEstimatorStateCoderMethod->[of,create],analyzeShutdownMethod->[create],requiresTimeSortedInput->[requiresTimeSortedInput],analyzeGetRestrictionCoderMethod->[of,create],usesGivenStateClass->[of],isSplittable->[isSplittable],getTimerFamilySpecOrThrow->[format]]]\nCodereview: ", "role": "user" }, { "content": "Technically, the design of the class is to use `parameter.match(new Cases() { ... })` but I'll accept this. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -31,6 +31,10 @@ public class ActorRestartTest extends BaseTest {\n return value;\n }\n \n+ public boolean askRayWasCurrentActorRestarted() {\n+ return Ray.getRuntimeContext().wasCurrentActorRestarted();\n+ }\n+\n public int getPid() {\n return SystemUtil.pid();\n }\n\nCallgraph: \t[ActorRestartTest->[Counter->[getPid->[pid],wasCurrentActorRestarted],testActorRestart->[assertTrue,fail,sleep,get,remote,exec,assertFalse,assertEquals]]]\nCodereview: ", "role": "user" }, { "content": "what about `checkWasCurrentActorRestartedInActorTask`? and `wasCurrentActorRestarted` can be renamed to `checkWasCurrentActorRestartedInActorCreationTask` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -34,6 +34,16 @@ public class FindInFilesEvent extends GwtEvent<FindInFilesEvent.Handler>\n return searchPattern_;\n }\n \n+ public boolean getReplace()\n+ {\n+ return replace_;\n+ }\n+\n+ public String getReplacePattern()\n+ {\n+ return replacePattern_;\n+ }\n+\n @Override\n public Type<Handler> getAssociatedType()\n {\n\nCallgraph: \t[FindInFilesEvent->[dispatch->[onFindInFiles]]]\nCodereview: ", "role": "user" }, { "content": "Nit: Could you rename this to something that sounds like a boolean phrase like `isReplace` or `replaceEnabeled`? Right now the name feels to me like it should return a replace string </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -264,4 +264,18 @@ public abstract class ServerNotification extends EventObject implements MuleCont\n return resource;\n }\n \n+ public static boolean resolveEventReference(MuleEvent event)\n+ {\n+ if (event instanceof VoidMuleEvent)\n+ {\n+ return true;\n+ }\n+ \n+ if (event instanceof DefaultMuleEvent)\n+ {\n+ return ((DefaultMuleEvent) event).resolveEventSynchronicity();\n+ }\n+ \n+ return event.isSynchronous();\n+ }\n }\n\nCallgraph: \t[ServerNotification->[copyResource->[cloneMessage],getActionName->[getActionName],toString->[getServerId],getServerId->[generateId],getPayloadToString->[toString]]]\nCodereview: ", "role": "user" }, { "content": "only have this check and return true otherwise </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -32,6 +32,11 @@ public class MethodNameDeclaration extends AbstractNameDeclaration {\n return p.isVarargs();\n }\n \n+ public boolean isPrimitiveReturnType() {\n+ return getMethodNameDeclaratorNode().getParent().getResultType().getChild(0)\n+ .getChild(0) instanceof ASTPrimitiveType;\n+ }\n+\n public ASTMethodDeclarator getMethodNameDeclaratorNode() {\n return (ASTMethodDeclarator) node;\n }\nCallgraph: \t[MethodNameDeclaration->[getParameterDisplaySignature->[getParameterCount,isVarargs],isVarargs->[isVarargs],toString->[getParameterCount],equals->[getParameterCount,isVarargs,equals],hashCode->[getParameterCount,hashCode],getParameterCount->[getParameterCount]]]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -32,6 +32,11 @@ public class DubboInstrumentationModule extends InstrumentationModule {\n return hasClassesNamed(\"org.apache.dubbo.rpc.Filter\");\n }\n \n+ @Override\n+ public boolean isLibraryInstrumentationClass(String className) {\n+ return className.startsWith(\"io.opentelemetry.instrumentation.apachedubbo.v2_7\");\n+ }\n+\n @Override\n public List<TypeInstrumentation> typeInstrumentations() {\n return Collections.singletonList(new DubboInstrumentation());\n\nCallgraph: \t[DubboInstrumentationModule->[typeInstrumentations->[singletonList,DubboInstrumentation],classLoaderMatcher->[hasClassesNamed]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nCan this be replaced with `this.getClass().getPackage().getName()` and moved to superclass? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -2530,6 +2530,17 @@ public class DoFnSignatures {\n return signatureForDoFn(doFn).usesState() || requiresTimeSortedInput(doFn);\n }\n \n+ private static boolean containsBundleFinalizer(List<Parameter> parameters) {\n+ return parameters.stream().anyMatch(parameter -> parameter instanceof BundleFinalizerParameter);\n+ }\n+\n+ public static boolean usesBundleFinalizer(DoFn<?, ?> doFn) {\n+ DoFnSignature sig = signatureForDoFn(doFn);\n+ return containsBundleFinalizer(sig.startBundle().extraParameters())\n+ || containsBundleFinalizer(sig.finishBundle().extraParameters())\n+ || containsBundleFinalizer(sig.processElement().extraParameters());\n+ }\n+\n public static boolean requiresTimeSortedInput(DoFn<?, ?> doFn) {\n return signatureForDoFn(doFn).processElement().requiresTimeSortedInput();\n }\n\nCallgraph: \t[DoFnSignatures->[getStateSpecOrThrow->[format],analyzeTimerFamilyDeclarations->[create],analyzeProcessElementMethod->[of,getExtraParameters,addParameter,create,setParameter],analyzeStateDeclarations->[of,create,getType],analyzeExtraParameter->[of,getAnnotations,doFnStartBundleContextTypeOf,hasParameter,doFnProcessContextTypeOf,getType,getMethod,doFnOnTimerContextTypeOf,getIndex,doFnFinishBundleContextTypeOf,doFnOnWindowExpirationContextTypeOf,getDeclaringClass],validateTimerField->[getType],ErrorReporter->[forParameter->[ErrorReporter,getIndex,format,getType],forMethod->[ErrorReporter,format],throwIllegalArgument->[format],checkArgument->[throwIllegalArgument],checkNotNull->[throwIllegalArgument],format],MethodAnalysisContext->[create->[MethodAnalysisContext]],parseSignature->[of,getTimerDeclarations,addTimerFamilyDeclarations,getTimerFamilyDeclarations,addStateDeclarations,addFieldAccessDeclarations,create,getStateDeclarations,getFieldAccessDeclarations,addTimerDeclarations],analyzeOnTimerFamilyMethod->[of,create],verifySplittableMethods->[of],analyzeOnWindowExpirationMethod->[of,create],getTimerSpecOrThrow->[format],FnAnalysisContext->[addTimerFamilyDeclarations->[addTimerFamilyDeclaration],addStateDeclarations->[addStateDeclaration],addFieldAccessDeclarations->[addFieldAccessDeclaration],create->[FnAnalysisContext],addTimerDeclarations->[addTimerDeclaration]],analyzeSplitRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],getDeclaringClass->[getDeclaringClass],analyzeOnTimerMethod->[of,create],analyzeGetInitialWatermarkEstimatorStateMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],analyzeNewWatermarkEstimatorMethod->[of,addParameter,getExtraParameters,create,watermarkEstimatorTypeOf,analyzeExtraParameter,getWindowType,checkParameterOneOf],analyzeGetSizeMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],format->[getType],analyzeStartBundleMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],analyzeGetInitialRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],validateTimerFamilyField->[getType],analyzeFieldAccessDeclaration->[create,getType],analyzeNewTrackerMethod->[of,addParameter,getExtraParameters,create,restrictionTrackerTypeOf,getWindowType,analyzeExtraParameter,checkParameterOneOf],analyzeTruncateRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],usesTimers->[usesTimers],analyzeSetupMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],analyzeTimerDeclarations->[create],analyzeFinishBundleMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],usesState->[usesState],analyzeGetWatermarkEstimatorStateCoderMethod->[of,create],analyzeShutdownMethod->[create],requiresTimeSortedInput->[requiresTimeSortedInput],analyzeGetRestrictionCoderMethod->[of,create],usesGivenStateClass->[of],isSplittable->[isSplittable],getTimerFamilySpecOrThrow->[format]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nTechnically, the design of the class is to use `parameter.match(new Cases() { ... })` but I'll accept this. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -31,6 +31,10 @@ public class ActorRestartTest extends BaseTest {\n return value;\n }\n \n+ public boolean askRayWasCurrentActorRestarted() {\n+ return Ray.getRuntimeContext().wasCurrentActorRestarted();\n+ }\n+\n public int getPid() {\n return SystemUtil.pid();\n }\n\nCallgraph: \t[ActorRestartTest->[Counter->[getPid->[pid],wasCurrentActorRestarted],testActorRestart->[assertTrue,fail,sleep,get,remote,exec,assertFalse,assertEquals]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nwhat about `checkWasCurrentActorRestartedInActorTask`? and `wasCurrentActorRestarted` can be renamed to `checkWasCurrentActorRestartedInActorCreationTask` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -34,6 +34,16 @@ public class FindInFilesEvent extends GwtEvent<FindInFilesEvent.Handler>\n return searchPattern_;\n }\n \n+ public boolean getReplace()\n+ {\n+ return replace_;\n+ }\n+\n+ public String getReplacePattern()\n+ {\n+ return replacePattern_;\n+ }\n+\n @Override\n public Type<Handler> getAssociatedType()\n {\n\nCallgraph: \t[FindInFilesEvent->[dispatch->[onFindInFiles]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nNit: Could you rename this to something that sounds like a boolean phrase like `isReplace` or `replaceEnabeled`? Right now the name feels to me like it should return a replace string </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -264,4 +264,18 @@ public abstract class ServerNotification extends EventObject implements MuleCont\n return resource;\n }\n \n+ public static boolean resolveEventReference(MuleEvent event)\n+ {\n+ if (event instanceof VoidMuleEvent)\n+ {\n+ return true;\n+ }\n+ \n+ if (event instanceof DefaultMuleEvent)\n+ {\n+ return ((DefaultMuleEvent) event).resolveEventSynchronicity();\n+ }\n+ \n+ return event.isSynchronous();\n+ }\n }\n\nCallgraph: \t[ServerNotification->[copyResource->[cloneMessage],getActionName->[getActionName],toString->[getServerId],getServerId->[generateId],getPayloadToString->[toString]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nonly have this check and return true otherwise </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -32,6 +32,11 @@ public class MethodNameDeclaration extends AbstractNameDeclaration {\n return p.isVarargs();\n }\n \n+ public boolean isPrimitiveReturnType() {\n+ return getMethodNameDeclaratorNode().getParent().getResultType().getChild(0)\n+ .getChild(0) instanceof ASTPrimitiveType;\n+ }\n+\n public ASTMethodDeclarator getMethodNameDeclaratorNode() {\n return (ASTMethodDeclarator) node;\n }\nCallgraph: \t[MethodNameDeclaration->[getParameterDisplaySignature->[getParameterCount,isVarargs],isVarargs->[isVarargs],toString->[getParameterCount],equals->[getParameterCount,isVarargs,equals],hashCode->[getParameterCount,hashCode],getParameterCount->[getParameterCount]]]\nCodereview: ", "role": "user" } ]
428337f896113abb
{ "callgraph": "[RefactoringChecker->[leave_module->[_init],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_augassign->[_check_consider_using_join],visit_if->[_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_for->[_check_redefined_argument_from_local],_check_nested_blocks->[_is_actual_elif],_is_node_return_ended->[_is_node_return_ended],_check_consider_get->[type_and_name_are_equal],_check_superfluous_else_return->[_is_actual_elif,_if_statement_is_always_returning],visit_assign->[_check_swap_variables],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],visit_boolop->[_check_consider_using_in,_check_consider_merging_isinstance],visit_with->[_check_redefined_argument_from_local],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],visit_excepthandler->[_check_redefined_argument_from_local]],_if_statement_is_always_returning->[_has_return_node->[_if_statement_is_always_returning],_has_return_node,_all_elements_are_true],RecommandationChecker->[visit_for->[_is_builtin]],is_trailing_comma->[get_curline_index_start],LenChecker->[visit_compare->[_is_len_call,_is_constant_zero,_has_constant_value,_node_is_test_condition],visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]", "msg": "I'd rephrase it as `Simplify chained comparison between the operands`.", "patch": "@@ -155,6 +155,10 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n 'if a key is present or a default if not, is simpler and considered '\n 'more idiomatic, although sometimes a bit slower'\n ),\n+ 'R1716': ('simplify chained comparison',\n+ 'chained-comparison',\n+ 'Chained comparisons like \"a < b and b < c\" can be simplified as \"a < b < c\"',\n+ ),\n }\n options = (('max-nested-blocks',\n {'default': 5, 'type': 'int', 'metavar': '<int>',", "summary": "Requirements for the n - nested - block function. Constructor for a TokenChecker class." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -81,10 +81,11 @@ class RequirementSet(object):\n wheel.filename\n )\n \n- install_req.use_user_site = self.use_user_site\n- install_req.target_dir = self.target_dir\n- install_req.pycompile = self.pycompile\n- install_req.is_direct = (parent_req_name is None)\n+ # This next bit is really a sanity check.\n+ assert install_req.is_direct == (parent_req_name is None), (\n+ \"a direct req shouldn't have a parent and also, \"\n+ \"a non direct req should have a parent\"\n+ )\n \n if not name:\n # url or path requirement w/o an egg fragment\n\nCallgraph: \t[RequirementSet->[_to_install->[schedule->[schedule],schedule],install->[_to_install,install]]]\nCodereview: ", "role": "user" }, { "content": "@pfmoore the intention is to have requirementset.add do less. By moving this outside, I've tried to make it explicit which paths go which way. This makes it easier to keep track of what's happening (because this bit of code is highly intertwined). I'm sort of trying to untangle this bit of code here. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -81,10 +81,11 @@ class RequirementSet(object):\n wheel.filename\n )\n \n- install_req.use_user_site = self.use_user_site\n- install_req.target_dir = self.target_dir\n- install_req.pycompile = self.pycompile\n- install_req.is_direct = (parent_req_name is None)\n+ # This next bit is really a sanity check.\n+ assert install_req.is_direct == (parent_req_name is None), (\n+ \"a direct req shouldn't have a parent and also, \"\n+ \"a non direct req should have a parent\"\n+ )\n \n if not name:\n # url or path requirement w/o an egg fragment\n\nCallgraph: \t[RequirementSet->[_to_install->[schedule->[schedule],schedule],install->[_to_install,install]]]\nCodereview: ", "role": "user" }, { "content": "@pfmoore the intention is to have requirementset.add do less. By moving this outside, I've tried to make it explicit which paths go which way. This makes it easier to keep track of what's happening (because this bit of code is highly intertwined). I'm sort of trying to untangle this bit of code here. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -97,9 +97,9 @@ def test_state_operators():\n \n \n def test_event_operators():\n- a = EventTransferSentSuccess(2)\n- b = EventTransferSentSuccess(2)\n- c = EventTransferSentSuccess(3)\n+ a = EventTransferSentSuccess(2, 5, sha3('target'))\n+ b = EventTransferSentSuccess(2, 5, sha3('target'))\n+ c = EventTransferSentSuccess(3, 4, sha3('target'))\n \n assert a == b\n assert not a != b\n\nCallgraph: \t[test_event_operators->[sha3,EventTransferSentSuccess,EventTransferReceivedSuccess,EventTransferSentFailed],test_transfer_statechange_operators->[ReceiveTransferDirect,ActionTransferDirect,ActionCancelTransfer,Block],test_message_operators->[Ack],test_state_operators->[RouteState,LockedTransferState,RoutesState],sha3]\nCodereview: ", "role": "user" }, { "content": "could you add a `d = EventTransferSentSuccess(3, 4, sha3('differenttarget'))` and assert on it being non-equal to `c`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -43,6 +43,13 @@ namespace Content.Server.GameObjects.Components.Metabolism\n serializer.DataField(this, b => b.NeedsGases, \"needsGases\", new Dictionary<Gas, float>());\n serializer.DataField(this, b => b.ProducesGases, \"producesGases\", new Dictionary<Gas, float>());\n serializer.DataField(this, b => b.DeficitGases, \"deficitGases\", new Dictionary<Gas, float>());\n+ serializer.DataField(this, b => b.MetabolismHeat, \"metabolismHeat\", 0);\n+ serializer.DataField(this, b => b.RadiatedHeat, \"radiatedHeat\", 0);\n+ serializer.DataField(this, b => b.SweatHeatRegulation, \"sweatHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.ShiveringHeatRegulation, \"shiveringHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.ImplicitHeatRegulation, \"implicitHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.NormalBodyTemperature, \"normalBodyTemperature\", 0);\n+ serializer.DataField(this, b => b.ThermalRegulationTemperatureThreshold, \"thermalRegulationTemperatureThreshold\", 0);\n serializer.DataField(ref _suffocationDamage, \"suffocationDamage\", 1);\n }\n \n\nCallgraph: \t[MetabolismComponent->[ProcessGases->[NeedsAndDeficit,ClampDeficit,GasProduced],GasProduced->[GasProducedMultiplier],GasMixture->[Transfer],Update->[ProcessGases,ProcessNutrients],ExposeData->[ExposeData]]]\nCodereview: ", "role": "user" }, { "content": "Maybe you should give those default values some sane numbers other than 0, just in case someone forgets to set them </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -120,8 +120,8 @@ public class DefaultCompositeByteBuf extends AbstractByteBuf implements Composit\n final int capacity = components.get(numComponents - 1).endOffset + readableBytes;\n \n ByteBuf consolidated = buffer.unsafe().newBuffer(capacity);\n- for (int i = 0; i < numComponents; i ++) {\n- ByteBuf b = components.get(i).buf;\n+ for (Component component : components) {\n+ ByteBuf b = component.buf;\n consolidated.writeBytes(b);\n b.unsafe().release();\n }\n\nCallgraph: \t[DefaultCompositeByteBuf->[toByteIndex->[checkComponentIndex],getLong->[getLong,getInt],getBytes->[toComponentIndex,capacity,getBytes],removeComponents->[checkComponentIndex,updateComponentOffsets],setInt->[setShort,setInt],removeComponent->[checkComponentIndex,updateComponentOffsets],isDirect->[isDirect],toNioBuffer->[nioBuffer,hasNioBuffer],component->[checkComponentIndex],getInt->[getInt,getShort],addComponent->[addComponent,addComponents],getByte->[getByte],hasArray->[hasArray],copyTo->[capacity,getBytes],nioBuffer->[nioBuffer],CompositeUnsafe->[newBuffer->[DefaultCompositeByteBuf,addComponent],release->[release],nioBuffers->[nioBuffer],discardSomeReadBytes->[discardReadComponents],nioBuffer->[nioBuffer]],hasNioBuffer->[hasNioBuffer],copy->[toComponentIndex,capacity],discardReadBytes->[toComponentIndex,capacity,updateComponentOffsets],capacity->[addComponent,capacity],addComponents->[addComponent,addComponents],getUnsignedMedium->[getByte,getShort,getUnsignedMedium],consolidate->[checkComponentIndex,numComponents,updateComponentOffsets],discardReadComponents->[toComponentIndex,capacity,updateComponentOffsets],setShort->[setShort,setByte],setMedium->[setShort,setMedium,setByte],nioBuffers->[toComponentIndex,capacity,nioBuffers],setByte->[setByte],arrayOffset->[arrayOffset],array->[array],findComponent->[capacity],setBytes->[toComponentIndex,capacity,setBytes],toComponentIndex->[capacity],setLong->[setInt,setLong],getShort->[getByte,getShort],toString->[toString],iterator->[iterator]]]\nCodereview: ", "role": "user" }, { "content": "Wouldn't this create a new iterator which adds some GC pressure? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -155,6 +155,10 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n 'if a key is present or a default if not, is simpler and considered '\n 'more idiomatic, although sometimes a bit slower'\n ),\n+ 'R1716': ('simplify chained comparison',\n+ 'chained-comparison',\n+ 'Chained comparisons like \"a < b and b < c\" can be simplified as \"a < b < c\"',\n+ ),\n }\n options = (('max-nested-blocks',\n {'default': 5, 'type': 'int', 'metavar': '<int>',\nCallgraph: \t[RefactoringChecker->[leave_module->[_init],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_augassign->[_check_consider_using_join],visit_if->[_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_for->[_check_redefined_argument_from_local],_check_nested_blocks->[_is_actual_elif],_is_node_return_ended->[_is_node_return_ended],_check_consider_get->[type_and_name_are_equal],_check_superfluous_else_return->[_is_actual_elif,_if_statement_is_always_returning],visit_assign->[_check_swap_variables],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],visit_boolop->[_check_consider_using_in,_check_consider_merging_isinstance],visit_with->[_check_redefined_argument_from_local],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],visit_excepthandler->[_check_redefined_argument_from_local]],_if_statement_is_always_returning->[_has_return_node->[_if_statement_is_always_returning],_has_return_node,_all_elements_are_true],RecommandationChecker->[visit_for->[_is_builtin]],is_trailing_comma->[get_curline_index_start],LenChecker->[visit_compare->[_is_len_call,_is_constant_zero,_has_constant_value,_node_is_test_condition],visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -81,10 +81,11 @@ class RequirementSet(object):\n wheel.filename\n )\n \n- install_req.use_user_site = self.use_user_site\n- install_req.target_dir = self.target_dir\n- install_req.pycompile = self.pycompile\n- install_req.is_direct = (parent_req_name is None)\n+ # This next bit is really a sanity check.\n+ assert install_req.is_direct == (parent_req_name is None), (\n+ \"a direct req shouldn't have a parent and also, \"\n+ \"a non direct req should have a parent\"\n+ )\n \n if not name:\n # url or path requirement w/o an egg fragment\n\nCallgraph: \t[RequirementSet->[_to_install->[schedule->[schedule],schedule],install->[_to_install,install]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\n@pfmoore the intention is to have requirementset.add do less. By moving this outside, I've tried to make it explicit which paths go which way. This makes it easier to keep track of what's happening (because this bit of code is highly intertwined). I'm sort of trying to untangle this bit of code here. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -81,10 +81,11 @@ class RequirementSet(object):\n wheel.filename\n )\n \n- install_req.use_user_site = self.use_user_site\n- install_req.target_dir = self.target_dir\n- install_req.pycompile = self.pycompile\n- install_req.is_direct = (parent_req_name is None)\n+ # This next bit is really a sanity check.\n+ assert install_req.is_direct == (parent_req_name is None), (\n+ \"a direct req shouldn't have a parent and also, \"\n+ \"a non direct req should have a parent\"\n+ )\n \n if not name:\n # url or path requirement w/o an egg fragment\n\nCallgraph: \t[RequirementSet->[_to_install->[schedule->[schedule],schedule],install->[_to_install,install]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\n@pfmoore the intention is to have requirementset.add do less. By moving this outside, I've tried to make it explicit which paths go which way. This makes it easier to keep track of what's happening (because this bit of code is highly intertwined). I'm sort of trying to untangle this bit of code here. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -97,9 +97,9 @@ def test_state_operators():\n \n \n def test_event_operators():\n- a = EventTransferSentSuccess(2)\n- b = EventTransferSentSuccess(2)\n- c = EventTransferSentSuccess(3)\n+ a = EventTransferSentSuccess(2, 5, sha3('target'))\n+ b = EventTransferSentSuccess(2, 5, sha3('target'))\n+ c = EventTransferSentSuccess(3, 4, sha3('target'))\n \n assert a == b\n assert not a != b\n\nCallgraph: \t[test_event_operators->[sha3,EventTransferSentSuccess,EventTransferReceivedSuccess,EventTransferSentFailed],test_transfer_statechange_operators->[ReceiveTransferDirect,ActionTransferDirect,ActionCancelTransfer,Block],test_message_operators->[Ack],test_state_operators->[RouteState,LockedTransferState,RoutesState],sha3]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\ncould you add a `d = EventTransferSentSuccess(3, 4, sha3('differenttarget'))` and assert on it being non-equal to `c`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -43,6 +43,13 @@ namespace Content.Server.GameObjects.Components.Metabolism\n serializer.DataField(this, b => b.NeedsGases, \"needsGases\", new Dictionary<Gas, float>());\n serializer.DataField(this, b => b.ProducesGases, \"producesGases\", new Dictionary<Gas, float>());\n serializer.DataField(this, b => b.DeficitGases, \"deficitGases\", new Dictionary<Gas, float>());\n+ serializer.DataField(this, b => b.MetabolismHeat, \"metabolismHeat\", 0);\n+ serializer.DataField(this, b => b.RadiatedHeat, \"radiatedHeat\", 0);\n+ serializer.DataField(this, b => b.SweatHeatRegulation, \"sweatHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.ShiveringHeatRegulation, \"shiveringHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.ImplicitHeatRegulation, \"implicitHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.NormalBodyTemperature, \"normalBodyTemperature\", 0);\n+ serializer.DataField(this, b => b.ThermalRegulationTemperatureThreshold, \"thermalRegulationTemperatureThreshold\", 0);\n serializer.DataField(ref _suffocationDamage, \"suffocationDamage\", 1);\n }\n \n\nCallgraph: \t[MetabolismComponent->[ProcessGases->[NeedsAndDeficit,ClampDeficit,GasProduced],GasProduced->[GasProducedMultiplier],GasMixture->[Transfer],Update->[ProcessGases,ProcessNutrients],ExposeData->[ExposeData]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nMaybe you should give those default values some sane numbers other than 0, just in case someone forgets to set them </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -120,8 +120,8 @@ public class DefaultCompositeByteBuf extends AbstractByteBuf implements Composit\n final int capacity = components.get(numComponents - 1).endOffset + readableBytes;\n \n ByteBuf consolidated = buffer.unsafe().newBuffer(capacity);\n- for (int i = 0; i < numComponents; i ++) {\n- ByteBuf b = components.get(i).buf;\n+ for (Component component : components) {\n+ ByteBuf b = component.buf;\n consolidated.writeBytes(b);\n b.unsafe().release();\n }\n\nCallgraph: \t[DefaultCompositeByteBuf->[toByteIndex->[checkComponentIndex],getLong->[getLong,getInt],getBytes->[toComponentIndex,capacity,getBytes],removeComponents->[checkComponentIndex,updateComponentOffsets],setInt->[setShort,setInt],removeComponent->[checkComponentIndex,updateComponentOffsets],isDirect->[isDirect],toNioBuffer->[nioBuffer,hasNioBuffer],component->[checkComponentIndex],getInt->[getInt,getShort],addComponent->[addComponent,addComponents],getByte->[getByte],hasArray->[hasArray],copyTo->[capacity,getBytes],nioBuffer->[nioBuffer],CompositeUnsafe->[newBuffer->[DefaultCompositeByteBuf,addComponent],release->[release],nioBuffers->[nioBuffer],discardSomeReadBytes->[discardReadComponents],nioBuffer->[nioBuffer]],hasNioBuffer->[hasNioBuffer],copy->[toComponentIndex,capacity],discardReadBytes->[toComponentIndex,capacity,updateComponentOffsets],capacity->[addComponent,capacity],addComponents->[addComponent,addComponents],getUnsignedMedium->[getByte,getShort,getUnsignedMedium],consolidate->[checkComponentIndex,numComponents,updateComponentOffsets],discardReadComponents->[toComponentIndex,capacity,updateComponentOffsets],setShort->[setShort,setByte],setMedium->[setShort,setMedium,setByte],nioBuffers->[toComponentIndex,capacity,nioBuffers],setByte->[setByte],arrayOffset->[arrayOffset],array->[array],findComponent->[capacity],setBytes->[toComponentIndex,capacity,setBytes],toComponentIndex->[capacity],setLong->[setInt,setLong],getShort->[getByte,getShort],toString->[toString],iterator->[iterator]]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWouldn't this create a new iterator which adds some GC pressure? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -155,6 +155,10 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n 'if a key is present or a default if not, is simpler and considered '\n 'more idiomatic, although sometimes a bit slower'\n ),\n+ 'R1716': ('simplify chained comparison',\n+ 'chained-comparison',\n+ 'Chained comparisons like \"a < b and b < c\" can be simplified as \"a < b < c\"',\n+ ),\n }\n options = (('max-nested-blocks',\n {'default': 5, 'type': 'int', 'metavar': '<int>',\nCallgraph: \t[RefactoringChecker->[leave_module->[_init],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_augassign->[_check_consider_using_join],visit_if->[_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_for->[_check_redefined_argument_from_local],_check_nested_blocks->[_is_actual_elif],_is_node_return_ended->[_is_node_return_ended],_check_consider_get->[type_and_name_are_equal],_check_superfluous_else_return->[_is_actual_elif,_if_statement_is_always_returning],visit_assign->[_check_swap_variables],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],visit_boolop->[_check_consider_using_in,_check_consider_merging_isinstance],visit_with->[_check_redefined_argument_from_local],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],visit_excepthandler->[_check_redefined_argument_from_local]],_if_statement_is_always_returning->[_has_return_node->[_if_statement_is_always_returning],_has_return_node,_all_elements_are_true],RecommandationChecker->[visit_for->[_is_builtin]],is_trailing_comma->[get_curline_index_start],LenChecker->[visit_compare->[_is_len_call,_is_constant_zero,_has_constant_value,_node_is_test_condition],visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]\nCodereview: ", "role": "user" } ]
03d2d664448693b3
{ "callgraph": "[No CFG could be retrieved]", "msg": "can you replace the tabs with 2 spaces please to match the rest of the project?", "patch": "@@ -14,3 +14,17 @@ function roots_get_search_form($form) {\n return $form;\n }\n add_filter('get_search_form', 'roots_get_search_form');\n+\n+/**\n+ * Add page slug to body_class() classes if it doesn't exist\n+ */\n+function roots_body_class($classes) {\n+ // Add post/page slug\n+ if (is_single() || is_page() && !is_front_page()) {\n+ \tif (!in_array(basename(get_permalink()), $classes)) {\n+ \t\t$classes[] = basename(get_permalink());\n+ \t}\n+ }\n+ return $classes;\n+}\n+add_filter('body_class', 'roots_body_class');", "summary": "Get search form from roots." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -14,3 +14,17 @@ export function useResourcesNotify() {\n }\n });\n }\n+\n+/**\n+ * Combines multiple refs to pass into `ref` prop.\n+ * @param {...any} refs\n+ * @return {function(!Element)}\n+ */\n+export function refs(...refs) {\n+ return (element) => {\n+ for (let i = 0; i < refs.length; i++) {\n+ const ref = refs[i];\n+ typeof ref == 'function' ? ref(element) : (ref.current = element);\n+ }\n+ };\n+}\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Use `useCallback` to avoid trashing the ref. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -804,9 +804,10 @@ export class NextPageService {\n * Add the provided page metadata into the queue of\n * pages to fetch\n * @param {!Array<!./page.PageMeta>} pages\n+ * @param {boolean} preventFetching\n * @return {!Promise}\n */\n- queuePages_(pages) {\n+ queuePages_(pages, preventFetching = false) {\n if (!pages.length || this.finished_) {\n return Promise.resolve();\n }\n\nCallgraph: \t[NextPageService->[fetchPageDocument->[text,write,xhrFor,user,url,close,open,validateUrl],initializePageQueue_->[userAssert,user,length,resolve],constructor->[viewportForDoc,templatesFor,mutatorForDoc,win],maybeFetchNext->[fetch,resolve,QUEUED,FAILED,FETCHING,is],sanitizeDoc->[querySelectorAll,removeElement,toArray,body],refreshDefaultRecBox_->[href,dev,htmlFor,addEventListener,html,appendChild,preventDefault,htmlRefs,triggerAnalyticsEvent,image,url,isLoaded,FETCHING,is,title,removeChildren,src,textContent,forEach],createDocumentContainerForPage->[dev,relativePos,classList,appendChild],attachDocumentToPage->[installStylesForDoc,then,resolve,escapeCssSelectorIdent,dev,PRERENDER,PAUSED,replaceChild,getBody,is,devAssert,classList,container,insertAtStart,ampdoc,scopedQuerySelector],getRecBox_->[childElementByAttr],whenFirstScroll_->[resolve,unlisten],getSeparatorElement_->[setAttribute,hasAttribute,childElementByAttr,removeElement],getRemotePages_->[user,ALL,resolve,batchFetchJsonFor],resumePausedPages_->[all,max,min,PAUSED,is,resume,map],toggleHiddenAndReplaceableElements->[getAttribute,setAttribute,querySelectorAll,toArray,random,String,now,toggle,floor],buildDefaultSeparator_->[htmlFor,html],updateVisibility->[findIndex,HIDDEN,OUTSIDE_VIEWPORT,LEAVING_VIEWPORT,relativePos,setVisibility,devAssert,document,isVisible,VISIBLE],getHost_->[dev],queuePages_->[resolve,validatePage,user,url,forEach,length,initialUrl],createHostPage->[parseSchemaImage,parseFavicon,INSERTED,parseOgImage,VISIBLE],buildDefaultRecBox_->[htmlFor,html],hidePreviousPages_->[HIDDEN,all,OUTSIDE_VIEWPORT,pause,relativePos,filter,setVisibility,isVisible],getPageIndex_->[dev,indexOf],maybeRenderSeparatorTemplate_->[removeChildren,resolve,image,dev,appendChild,url,title],getInlinePages_->[childElementsByTag,userAssert,user,removeElement,textContent,tryParseJson,length,isJsonScriptTag],getViewportsAway_->[round],build->[resolve,timerFor,parseInt,user,extensionsFor,ampdocServiceFor,historyForDoc,insertAtStart,navigationForDoc],closeDocument->[resolve,escapeCssSelectorIdent,setStyles,dev,/*REVIEW*/,PAUSED,replaceChild,is,classList,container,scopedQuerySelector],setTitlePage->[dev,triggerAnalyticsEvent],renderRecBoxTemplate_->[removeChildren,image,dev,appendChild,url,isLoaded,FETCHING,is,devAssert,title]],resolve]\nCodereview: ", "role": "user" }, { "content": "Instead of using a boolean parameter, can we rename this method `fetchAndQueuePages` which calls a more concise version of `queuePages_` that we can use above? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -422,6 +422,17 @@ function triggerRenderStart(opt_data) {\n */\n function observeIntersection(observerCallback) {\n // Send request to received records.\n+ if (window.IntersectionObserver && window.IntersectionObserver.prototype) {\n+ // use native IntersectionObserver if exist\n+ const io = new window.IntersectionObserver(changes => {\n+ observerCallback(changes);\n+ }, {\n+ threshold: DEFAULT_THRESHOLD,\n+ });\n+ io.observe(window.document.documentElement);\n+ const unlistener = () => io.unobserve(window.document.documentElement);\n+ return unlistener;\n+ }\n nonSensitiveDataPostMessage('send-intersections');\n return listenParent(window, 'intersection', data => {\n observerCallback(data.changes);\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "return in the above line? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -318,7 +318,16 @@ export function getParentWindow(win) {\n * @return {!Window}\n */\n export function getTopWindow(win) {\n- return win.__AMP_TOP || win;\n+ const top = win.__AMP_TOP;\n+ if (top === null) {\n+ return win;\n+ }\n+ if (top != null) {\n+ return top;\n+ }\n+ // Make this defined but null to speed up future lookups.\n+ win.__AMP_TOP = null;\n+ return win;\n }\n \n /**\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "We could set this to `win` instead? Then keep the same `||`: `win.__AMP_TOP || (win.__AMP_TOP = win)` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -318,8 +318,14 @@ const addReturnValueToEvent = (event) => {\n })\n }\n \n+let warnedAboutRendererProcessReuse = false\n+\n // Add JavaScript wrappers for WebContents class.\n WebContents.prototype._init = function () {\n+ if (!warnedAboutRendererProcessReuse && app._allowRendererProcessReuseIsDefaultValue) {\n+ deprecate.log('The default value of app.allowRendererProcessReuse is deprecated, it is currently \"false\". It will change to be \"true\" in Electron 9. For more information please check https://github.com/electron/electron/issues/18397')\n+ warnedAboutRendererProcessReuse = true\n+ }\n // The navigation controller.\n NavigationController.call(this, this)\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "want to use `deprecate.warnOnce` or similar? that pays attention to `process.noDeprecation` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -14,3 +14,17 @@ function roots_get_search_form($form) {\n return $form;\n }\n add_filter('get_search_form', 'roots_get_search_form');\n+\n+/**\n+ * Add page slug to body_class() classes if it doesn't exist\n+ */\n+function roots_body_class($classes) {\n+ // Add post/page slug\n+ if (is_single() || is_page() && !is_front_page()) {\n+ \tif (!in_array(basename(get_permalink()), $classes)) {\n+ \t\t$classes[] = basename(get_permalink());\n+ \t}\n+ }\n+ return $classes;\n+}\n+add_filter('body_class', 'roots_body_class');\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -14,3 +14,17 @@ export function useResourcesNotify() {\n }\n });\n }\n+\n+/**\n+ * Combines multiple refs to pass into `ref` prop.\n+ * @param {...any} refs\n+ * @return {function(!Element)}\n+ */\n+export function refs(...refs) {\n+ return (element) => {\n+ for (let i = 0; i < refs.length; i++) {\n+ const ref = refs[i];\n+ typeof ref == 'function' ? ref(element) : (ref.current = element);\n+ }\n+ };\n+}\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nUse `useCallback` to avoid trashing the ref. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -804,9 +804,10 @@ export class NextPageService {\n * Add the provided page metadata into the queue of\n * pages to fetch\n * @param {!Array<!./page.PageMeta>} pages\n+ * @param {boolean} preventFetching\n * @return {!Promise}\n */\n- queuePages_(pages) {\n+ queuePages_(pages, preventFetching = false) {\n if (!pages.length || this.finished_) {\n return Promise.resolve();\n }\n\nCallgraph: \t[NextPageService->[fetchPageDocument->[text,write,xhrFor,user,url,close,open,validateUrl],initializePageQueue_->[userAssert,user,length,resolve],constructor->[viewportForDoc,templatesFor,mutatorForDoc,win],maybeFetchNext->[fetch,resolve,QUEUED,FAILED,FETCHING,is],sanitizeDoc->[querySelectorAll,removeElement,toArray,body],refreshDefaultRecBox_->[href,dev,htmlFor,addEventListener,html,appendChild,preventDefault,htmlRefs,triggerAnalyticsEvent,image,url,isLoaded,FETCHING,is,title,removeChildren,src,textContent,forEach],createDocumentContainerForPage->[dev,relativePos,classList,appendChild],attachDocumentToPage->[installStylesForDoc,then,resolve,escapeCssSelectorIdent,dev,PRERENDER,PAUSED,replaceChild,getBody,is,devAssert,classList,container,insertAtStart,ampdoc,scopedQuerySelector],getRecBox_->[childElementByAttr],whenFirstScroll_->[resolve,unlisten],getSeparatorElement_->[setAttribute,hasAttribute,childElementByAttr,removeElement],getRemotePages_->[user,ALL,resolve,batchFetchJsonFor],resumePausedPages_->[all,max,min,PAUSED,is,resume,map],toggleHiddenAndReplaceableElements->[getAttribute,setAttribute,querySelectorAll,toArray,random,String,now,toggle,floor],buildDefaultSeparator_->[htmlFor,html],updateVisibility->[findIndex,HIDDEN,OUTSIDE_VIEWPORT,LEAVING_VIEWPORT,relativePos,setVisibility,devAssert,document,isVisible,VISIBLE],getHost_->[dev],queuePages_->[resolve,validatePage,user,url,forEach,length,initialUrl],createHostPage->[parseSchemaImage,parseFavicon,INSERTED,parseOgImage,VISIBLE],buildDefaultRecBox_->[htmlFor,html],hidePreviousPages_->[HIDDEN,all,OUTSIDE_VIEWPORT,pause,relativePos,filter,setVisibility,isVisible],getPageIndex_->[dev,indexOf],maybeRenderSeparatorTemplate_->[removeChildren,resolve,image,dev,appendChild,url,title],getInlinePages_->[childElementsByTag,userAssert,user,removeElement,textContent,tryParseJson,length,isJsonScriptTag],getViewportsAway_->[round],build->[resolve,timerFor,parseInt,user,extensionsFor,ampdocServiceFor,historyForDoc,insertAtStart,navigationForDoc],closeDocument->[resolve,escapeCssSelectorIdent,setStyles,dev,/*REVIEW*/,PAUSED,replaceChild,is,classList,container,scopedQuerySelector],setTitlePage->[dev,triggerAnalyticsEvent],renderRecBoxTemplate_->[removeChildren,image,dev,appendChild,url,isLoaded,FETCHING,is,devAssert,title]],resolve]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nInstead of using a boolean parameter, can we rename this method `fetchAndQueuePages` which calls a more concise version of `queuePages_` that we can use above? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -422,6 +422,17 @@ function triggerRenderStart(opt_data) {\n */\n function observeIntersection(observerCallback) {\n // Send request to received records.\n+ if (window.IntersectionObserver && window.IntersectionObserver.prototype) {\n+ // use native IntersectionObserver if exist\n+ const io = new window.IntersectionObserver(changes => {\n+ observerCallback(changes);\n+ }, {\n+ threshold: DEFAULT_THRESHOLD,\n+ });\n+ io.observe(window.document.documentElement);\n+ const unlistener = () => io.unobserve(window.document.documentElement);\n+ return unlistener;\n+ }\n nonSensitiveDataPostMessage('send-intersections');\n return listenParent(window, 'intersection', data => {\n observerCallback(data.changes);\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nreturn in the above line? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -318,7 +318,16 @@ export function getParentWindow(win) {\n * @return {!Window}\n */\n export function getTopWindow(win) {\n- return win.__AMP_TOP || win;\n+ const top = win.__AMP_TOP;\n+ if (top === null) {\n+ return win;\n+ }\n+ if (top != null) {\n+ return top;\n+ }\n+ // Make this defined but null to speed up future lookups.\n+ win.__AMP_TOP = null;\n+ return win;\n }\n \n /**\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nWe could set this to `win` instead? Then keep the same `||`: `win.__AMP_TOP || (win.__AMP_TOP = win)` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -318,8 +318,14 @@ const addReturnValueToEvent = (event) => {\n })\n }\n \n+let warnedAboutRendererProcessReuse = false\n+\n // Add JavaScript wrappers for WebContents class.\n WebContents.prototype._init = function () {\n+ if (!warnedAboutRendererProcessReuse && app._allowRendererProcessReuseIsDefaultValue) {\n+ deprecate.log('The default value of app.allowRendererProcessReuse is deprecated, it is currently \"false\". It will change to be \"true\" in Electron 9. For more information please check https://github.com/electron/electron/issues/18397')\n+ warnedAboutRendererProcessReuse = true\n+ }\n // The navigation controller.\n NavigationController.call(this, this)\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nwant to use `deprecate.warnOnce` or similar? that pays attention to `process.noDeprecation` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -14,3 +14,17 @@ function roots_get_search_form($form) {\n return $form;\n }\n add_filter('get_search_form', 'roots_get_search_form');\n+\n+/**\n+ * Add page slug to body_class() classes if it doesn't exist\n+ */\n+function roots_body_class($classes) {\n+ // Add post/page slug\n+ if (is_single() || is_page() && !is_front_page()) {\n+ \tif (!in_array(basename(get_permalink()), $classes)) {\n+ \t\t$classes[] = basename(get_permalink());\n+ \t}\n+ }\n+ return $classes;\n+}\n+add_filter('body_class', 'roots_body_class');\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" } ]
567e3ca0398070bd
{ "callgraph": "[No CFG could be retrieved]", "msg": "Please explain why a user would enable this (space savings), and the requirements for this option to be safe.", "patch": "@@ -67,6 +67,10 @@ type Config struct {\n \t// If not set, it uses all versions available.\n \t// Warning: This API should not be considered stable and will change soon.\n \tVersions []protocol.VersionNumber\n+\t// Ask the server to truncate the connection ID sent in the Public Header.\n+\t// This saves 8 bytes in the Public Header in every packet. However, if the IP address of the server changes, the connection cannot be migrated.\n+\t// Currently only valid for the client.\n+\tRequestConnectionIDTruncation bool\n }\n \n // A Listener for incoming QUIC connections", "summary": " type is the constructor for a single config field." }
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -346,6 +346,10 @@ type ServiceAccountConfig struct {\n \t// Each key is tried in order until the list is exhausted or verification succeeds.\n \t// If no keys are specified, no service account authentication will be available.\n \tPublicKeyFiles []string\n+\n+\t// MasterCA is the CA for verifying the TLS connection back to the master. The service account controller will automatically\n+\t// inject the contents of this file into pods so they can verify connections to the master.\n+\tMasterCA string\n }\n \n type TokenConfig struct {\n\nCallgraph: \t[NewStringSet]\nCodereview: ", "role": "user" }, { "content": "I just realized that the OAuth config also needs this (and is currently incorrectly using servingInfo.clientCA instead - see `GetAPIServerCertCAPool`)... do we want this field replicated in several places, or a single top-level field? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -38,6 +38,12 @@ type Config struct {\n \t// step if not specified.\n \tDefaultEvaluationInterval time.Duration\n \n+\t// Directory for ActiveQueryTracker. If empty, ActiveQueryTracker will be disabled and MaxConcurrent will not be applied (!).\n+\t// ActiveQueryTracker logs queries that were active during the last crash, but logs them on the next startup.\n+\t// However, we need to use active query tracker, otherwise we cannot limit Max Concurrent queries in the PromQL\n+\t// engine.\n+\tActiveQueryTrackerDir string `yaml:\"active_query_tracking_dir\"`\n+\n \t// For testing, to prevent re-registration of metrics in the promql engine.\n \tmetricsRegisterer prometheus.Registerer `yaml:\"-\"`\n }\n\nCallgraph: \t[Err->[Err],LabelNames->[LabelNames],Next->[Next],At->[At],LabelValues->[LabelValues],Select->[Select]]\nCodereview: ", "role": "user" }, { "content": "`active_query_tracking_dir` > `active_query_tracker_dir` to be consistent with the CLI flag. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -234,6 +234,9 @@ type SecureServingInfo struct {\n \t// HTTP2MaxStreamsPerConnection is the limit that the api server imposes on each client.\n \t// A value of zero means to use the default provided by golang's HTTP/2 support.\n \tHTTP2MaxStreamsPerConnection int\n+\n+\t// HTTP1Only indicates that http2 should not be enabled.\n+\tHTTP1Only bool\n }\n \n type AuthenticationInfo struct {\n\nCallgraph: \t[HostPort->[SplitHostPort,Addr,String,Errorf,Atoi],New->[AddPostStartHookOrDie,LoadInt64,PreShutdownHooks,CompareAndSwapInt64,isPostStartHookRegistered,AddPostStartHook,Name,BuildHandlerChainFunc,NewRootAPIsHandler,Duration,Start,HealthzChecks,UnprotectedHandler,NotFoundHandler,Errorf,PostStartHooks],Complete->[Strings,Itoa,SplitHostPort,JoinHostPort,String,Fatalf,HostPort,Split,Complete],Duration,Unauthorized,Enabled,WithRequestInfo,SetBlockProfileRate,Add,WithMaxInFlightLimit,WebService,New,WithImpersonation,NewString,WithFailedAuthenticationAudit,WithWaitGroup,BasicLongRunningRequestCheck,WithCORS,WithAudit,WithPanicRecovery,StringFlagPutHandler,WithTimeoutForNonLongRunningRequests,WithAuthorization,NewFromTokens,WithAuthentication,Install,NewRandom,NewPrivilegedGroups,Insert,String,Trim]\nCodereview: ", "role": "user" }, { "content": "phrased negatively so the default `false` works. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -187,6 +187,9 @@ type TestParameters struct {\n \t// set to true to use production run mode in tests\n \tUseProductionRunMode bool\n \n+\t// Set to override the Keybase API server URI in a test.\n+\tServerURI string\n+\n \t// whether LogoutIfRevoked check should be skipped to avoid races\n \t// during resets.\n \tSkipLogoutIfRevokedCheck bool\n\nCallgraph: \t[GetGpgHome->[GetGpgHome,GetString,GetConfig,GetHome],GetInfoDir->[GetString],GetPvlKitFilename->[GetString,GetConfig,GetPvlKitFilename],GetLevelDBNumFiles->[getEnvInt,GetConfig,GetInt],GetGpg->[GetString,GetConfig,GetGpg],GetUpdatePreferenceSkip->[GetUpdatePreferenceSkip,GetConfig],GetLogFormat->[GetString,GetLogFormat,GetConfig],GetSlowGregorConn->[GetBool,GetSlowGregorConn,GetConfig,getEnvBool],GetLogPrefix->[GetLogPrefix],GetAttachmentDisableMulti->[GetBool,GetConfig,getEnvBool],getHomeFromCmdOrConfig->[GetString,GetConfig,GetHome],GetInstallID->[GetInstallID,GetUpdaterConfig],GetGregorDisabled->[GetGregorDisabled,GetBool,GetConfig],GetStoredSecretServiceName->[GetRunMode],GetKBFSInfoPath->[GetRuntimeDir],DarwinForceSecretStoreFile->[GetRunMode],GetSecretKeyringTemplate->[GetString,GetConfig,GetConfigDir,GetSecretKeyringTemplate],GetChatMemberType->[GetString],GetDbFilename->[GetDataDir,GetString,GetConfig,GetDbFilename],GetScraperTimeout->[GetConfig,getEnvDuration,GetDuration,GetScraperTimeout],GetGregorURI->[GetString,GetGregorURI,GetConfig,GetRunMode],GetServiceInfoPath->[GetRuntimeDir],GetMountDir->[GetString,GetConfig,GetRunMode,GetMountDir],GetDebug->[GetDebug,GetBool,GetConfig,getEnvBool],IsMobileExtension->[IsMobileExtension,GetBool,GetConfig,getEnvBool],GetPayloadCacheSize->[getEnvInt,GetConfig,GetInt],GetGpgOptions->[GetStringList,GetConfig,GetGpgOptions],GetServiceType->[GetString],GetProxy->[GetString,GetConfig,GetProxy],GetChatOutboxStorageEngine->[GetString,GetChatOutboxStorageEngine,GetConfig],GetUIDMapFullNameCacheSize->[getEnvInt,GetConfig,GetInt],GetGregorPingTimeout->[GetGregorPingTimeout,GetConfig,getEnvDuration,GetDuration],GetStandalone->[GetBool,GetStandalone,GetConfig,getEnvBool],GetLinkCacheSize->[getEnvInt,GetConfig,GetInt],GetTimers->[GetString,GetConfig,GetTimers],GetDefaultLogFile->[GetLogDir],GetUpdateLastChecked->[GetUpdateLastChecked,GetConfig],GetNoPinentry->[GetPinentry,GetBool,GetConfig,GetNoPinentry],GetConvSourceType->[GetString],SetUpdatePreferenceAuto->[SetUpdatePreferenceAuto,GetConfigWriter],WantsSystemd->[GetRunMode],GetTorProxy->[GetString,GetConfig,GetTorProxy],AllowPTrace->[GetBool,getEnvBool],GetUpdatePreferenceAuto->[GetUpdatePreferenceAuto,GetConfig],GetGregorPingInterval->[GetGregorPingInterval,GetConfig,getEnvDuration,GetDuration],GetUPAKCacheSize->[getEnvInt,GetConfig,GetInt],GetProofCacheLongDur->[GetConfig,getEnvDuration,GetDuration],GetProofCacheMediumDur->[GetConfig,getEnvDuration,GetDuration],SetUpdatePreferenceSkip->[SetUpdatePreferenceSkip,GetConfigWriter],GetServerURI->[GetString,GetConfig,GetServerURI,GetRunMode],GetProofCacheShortDur->[GetConfig,getEnvDuration,GetDuration],GetUsername->[GetConfig,GetUsername],GetRunModeAsString->[GetRunMode],GetProofCacheSize->[getEnvInt,GetConfig,GetInt],GetSocketBindFile->[GetString],GetSocketDialFiles->[defaultSocketFile,sandboxSocketFile],SetUpdatePreferenceSnoozeUntil->[SetUpdatePreferenceSnoozeUntil,GetConfigWriter],GetConfigFilename->[GetString,GetConfig,GetConfigDir,GetConfigFilename],GetAttachmentHTTPStartPort->[getEnvInt,GetConfig,GetInt],RememberPassphrase->[GetBool,GetConfig],GetDeviceIDForUID->[GetDeviceIDForUID,GetConfig],GetDeviceIDForUsername->[GetConfig,GetDeviceIDForUsername],SetUpdateLastChecked->[SetUpdateLastChecked,GetConfigWriter],GetDisplayRawUntrustedOutput->[GetDisplayRawUntrustedOutput,GetBool,GetConfig,getEnvBool],GetUseDefaultLogFile->[GetBool,getEnvBool],GetLocalTrackMaxAge->[GetLocalTrackMaxAge,GetConfig,getEnvDuration,GetDuration],GetUpdateDisabled->[GetConfig,GetUpdateDisabled],GetAvatarSource->[GetString],GetChatDbFilename->[GetDataDir,GetString,GetConfig,GetChatDbFilename],GetRuntimeDir->[GetString],GetUserCacheMaxAge->[GetUserCacheMaxAge,getEnvDuration,GetDuration,GetConfig],GetUID->[GetConfig,GetUID],GetBundledCA->[GetString,GetConfig,GetBundledCA],GetParamProofKitFilename->[GetString,GetConfig,GetParamProofKitFilename],GetAllowRoot->[GetBool,getEnvBool],getMobileSharedHomeFromCmdOrConfig->[GetString,GetConfig,GetMobileSharedHome],RunningInCI->[GetBool,getEnvBool],GetUpdaterConfigFilename->[GetUpdaterConfigFilename,GetString,GetConfig,GetConfigDir],GetUsernameForUID->[GetUsernameForUID,GetConfig],GetChatDelivererInterval->[GetChatDelivererInterval,getEnvDuration,GetDuration,GetConfig],GetTorHiddenAddress->[GetString,GetConfig,GetTorHiddenAddress],GetPinentry->[GetString,GetConfig,GetPinentry],GetLinkCacheCleanDur->[GetConfig,getEnvDuration,GetDuration],GetPidFile->[GetString,GetConfig,GetPidFile,GetInfoDir],GetLogFile->[GetString,GetLogFile],GetTorMode->[GetConfig,GetTorMode],GetUpdateURL->[GetConfig,GetUpdateURL],GetAPITimeout->[GetAPITimeout,GetConfig,getEnvDuration,GetDuration],GetDeviceID->[GetConfig,GetDeviceID],defaultSocketFile->[GetString,GetConfig,GetRuntimeDir,GetSocketFile],GetBGIdentifierDisabled->[GetBool,GetBGIdentifierDisabled,GetConfig],GetDoLogForward->[GetLocalRPCDebug],GetAPIDump->[GetBool,GetAPIDump,getEnvBool],GetAutoFork->[GetAutoFork,getEnvBool,GetNegBool,GetNoAutoFork,GetConfig],GetLabel->[GetString],GetSessionFilename->[GetString,GetSessionFilename,GetCacheDir,GetConfig],GetCodeSigningKIDs->[GetStringList,getEnvPath,GetCodeSigningKIDs,GetConfig,GetRunMode],GetEmailOrUsername->[GetEmail,GetUsername],GetGregorSaveInterval->[GetGregorSaveInterval,GetConfig,getEnvDuration,GetDuration],GetDisableTeamAuditor->[GetBool,GetConfig,getEnvBool],GetUpdatePreferenceSnoozeUntil->[GetConfig,GetUpdatePreferenceSnoozeUntil],GetVDebugSetting->[GetVDebugSetting,GetString,GetConfig],GetEmail->[GetString],GetReadDeletedSigChain->[GetBool,GetReadDeletedSigChain,GetConfig,getEnvBool],GetLocalRPCDebug->[GetString,GetConfig,GetLocalRPCDebug],GetRunMode->[GetConfig,GetRunMode],GetInboxSourceType->[GetString],GetMerkleKIDs->[GetStringList,GetMerkleKIDs,getEnvPath,GetConfig,GetRunMode],GetAppType->[GetConfig,GetAppType],GetDeviceCloneStateFilename->[GetString,GetConfig,GetDeviceCloneStateFilename,GetConfigDir],GetChatInboxSourceLocalizeThreads->[getEnvInt,GetConfig,GetInt],GetFeatureFlags->[GetFeatureFlags,GetConfig],GetStoredSecretAccessGroup->[GetBool,GetSecurityAccessGroupOverride,GetConfig],GetRunMode]\nCodereview: ", "role": "user" }, { "content": "do you need this or is it sufficient to just set the URI via env? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -294,6 +294,16 @@ type MasterConfig struct {\n \t// JenkinsPipelineConfig holds information about the default Jenkins template\n \t// used for JenkinsPipeline build strategy.\n \tJenkinsPipelineConfig JenkinsPipelineConfig\n+\n+\t// AuditConfig holds information related to auditing capabilities.\n+\tAuditConfig AuditConfig\n+}\n+\n+// AuditConfig holds configuration for the audit capabilities\n+type AuditConfig struct {\n+\t// If this flag is set, audit log will be printed in the logs.\n+\t// The logs contains, method, user and a requested URL.\n+\tEnabled bool\n }\n \n // JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy\n\nCallgraph: \t[StringKeySet,NewString]\nCodereview: ", "role": "user" }, { "content": "Let's just call this `Enabled`. In the future we can add handler configs for the destinations (basic, files, events, etc) and keep this master flag for the on/off. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -67,6 +67,10 @@ type Config struct {\n \t// If not set, it uses all versions available.\n \t// Warning: This API should not be considered stable and will change soon.\n \tVersions []protocol.VersionNumber\n+\t// Ask the server to truncate the connection ID sent in the Public Header.\n+\t// This saves 8 bytes in the Public Header in every packet. However, if the IP address of the server changes, the connection cannot be migrated.\n+\t// Currently only valid for the client.\n+\tRequestConnectionIDTruncation bool\n }\n \n // A Listener for incoming QUIC connections\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" } ]
[ { "content": "Please GIVE FORMAL Codereview for software developers in ONE SENTENCE for testcase, implementing Few Shot Learning from example. Dont start with Codereview/review. Just give the answer.", "role": "user" }, { "content": "Code: \t@@ -346,6 +346,10 @@ type ServiceAccountConfig struct {\n \t// Each key is tried in order until the list is exhausted or verification succeeds.\n \t// If no keys are specified, no service account authentication will be available.\n \tPublicKeyFiles []string\n+\n+\t// MasterCA is the CA for verifying the TLS connection back to the master. The service account controller will automatically\n+\t// inject the contents of this file into pods so they can verify connections to the master.\n+\tMasterCA string\n }\n \n type TokenConfig struct {\n\nCallgraph: \t[NewStringSet]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nI just realized that the OAuth config also needs this (and is currently incorrectly using servingInfo.clientCA instead - see `GetAPIServerCertCAPool`)... do we want this field replicated in several places, or a single top-level field? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -38,6 +38,12 @@ type Config struct {\n \t// step if not specified.\n \tDefaultEvaluationInterval time.Duration\n \n+\t// Directory for ActiveQueryTracker. If empty, ActiveQueryTracker will be disabled and MaxConcurrent will not be applied (!).\n+\t// ActiveQueryTracker logs queries that were active during the last crash, but logs them on the next startup.\n+\t// However, we need to use active query tracker, otherwise we cannot limit Max Concurrent queries in the PromQL\n+\t// engine.\n+\tActiveQueryTrackerDir string `yaml:\"active_query_tracking_dir\"`\n+\n \t// For testing, to prevent re-registration of metrics in the promql engine.\n \tmetricsRegisterer prometheus.Registerer `yaml:\"-\"`\n }\n\nCallgraph: \t[Err->[Err],LabelNames->[LabelNames],Next->[Next],At->[At],LabelValues->[LabelValues],Select->[Select]]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\n`active_query_tracking_dir` > `active_query_tracker_dir` to be consistent with the CLI flag. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -234,6 +234,9 @@ type SecureServingInfo struct {\n \t// HTTP2MaxStreamsPerConnection is the limit that the api server imposes on each client.\n \t// A value of zero means to use the default provided by golang's HTTP/2 support.\n \tHTTP2MaxStreamsPerConnection int\n+\n+\t// HTTP1Only indicates that http2 should not be enabled.\n+\tHTTP1Only bool\n }\n \n type AuthenticationInfo struct {\n\nCallgraph: \t[HostPort->[SplitHostPort,Addr,String,Errorf,Atoi],New->[AddPostStartHookOrDie,LoadInt64,PreShutdownHooks,CompareAndSwapInt64,isPostStartHookRegistered,AddPostStartHook,Name,BuildHandlerChainFunc,NewRootAPIsHandler,Duration,Start,HealthzChecks,UnprotectedHandler,NotFoundHandler,Errorf,PostStartHooks],Complete->[Strings,Itoa,SplitHostPort,JoinHostPort,String,Fatalf,HostPort,Split,Complete],Duration,Unauthorized,Enabled,WithRequestInfo,SetBlockProfileRate,Add,WithMaxInFlightLimit,WebService,New,WithImpersonation,NewString,WithFailedAuthenticationAudit,WithWaitGroup,BasicLongRunningRequestCheck,WithCORS,WithAudit,WithPanicRecovery,StringFlagPutHandler,WithTimeoutForNonLongRunningRequests,WithAuthorization,NewFromTokens,WithAuthentication,Install,NewRandom,NewPrivilegedGroups,Insert,String,Trim]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nphrased negatively so the default `false` works. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -187,6 +187,9 @@ type TestParameters struct {\n \t// set to true to use production run mode in tests\n \tUseProductionRunMode bool\n \n+\t// Set to override the Keybase API server URI in a test.\n+\tServerURI string\n+\n \t// whether LogoutIfRevoked check should be skipped to avoid races\n \t// during resets.\n \tSkipLogoutIfRevokedCheck bool\n\nCallgraph: \t[GetGpgHome->[GetGpgHome,GetString,GetConfig,GetHome],GetInfoDir->[GetString],GetPvlKitFilename->[GetString,GetConfig,GetPvlKitFilename],GetLevelDBNumFiles->[getEnvInt,GetConfig,GetInt],GetGpg->[GetString,GetConfig,GetGpg],GetUpdatePreferenceSkip->[GetUpdatePreferenceSkip,GetConfig],GetLogFormat->[GetString,GetLogFormat,GetConfig],GetSlowGregorConn->[GetBool,GetSlowGregorConn,GetConfig,getEnvBool],GetLogPrefix->[GetLogPrefix],GetAttachmentDisableMulti->[GetBool,GetConfig,getEnvBool],getHomeFromCmdOrConfig->[GetString,GetConfig,GetHome],GetInstallID->[GetInstallID,GetUpdaterConfig],GetGregorDisabled->[GetGregorDisabled,GetBool,GetConfig],GetStoredSecretServiceName->[GetRunMode],GetKBFSInfoPath->[GetRuntimeDir],DarwinForceSecretStoreFile->[GetRunMode],GetSecretKeyringTemplate->[GetString,GetConfig,GetConfigDir,GetSecretKeyringTemplate],GetChatMemberType->[GetString],GetDbFilename->[GetDataDir,GetString,GetConfig,GetDbFilename],GetScraperTimeout->[GetConfig,getEnvDuration,GetDuration,GetScraperTimeout],GetGregorURI->[GetString,GetGregorURI,GetConfig,GetRunMode],GetServiceInfoPath->[GetRuntimeDir],GetMountDir->[GetString,GetConfig,GetRunMode,GetMountDir],GetDebug->[GetDebug,GetBool,GetConfig,getEnvBool],IsMobileExtension->[IsMobileExtension,GetBool,GetConfig,getEnvBool],GetPayloadCacheSize->[getEnvInt,GetConfig,GetInt],GetGpgOptions->[GetStringList,GetConfig,GetGpgOptions],GetServiceType->[GetString],GetProxy->[GetString,GetConfig,GetProxy],GetChatOutboxStorageEngine->[GetString,GetChatOutboxStorageEngine,GetConfig],GetUIDMapFullNameCacheSize->[getEnvInt,GetConfig,GetInt],GetGregorPingTimeout->[GetGregorPingTimeout,GetConfig,getEnvDuration,GetDuration],GetStandalone->[GetBool,GetStandalone,GetConfig,getEnvBool],GetLinkCacheSize->[getEnvInt,GetConfig,GetInt],GetTimers->[GetString,GetConfig,GetTimers],GetDefaultLogFile->[GetLogDir],GetUpdateLastChecked->[GetUpdateLastChecked,GetConfig],GetNoPinentry->[GetPinentry,GetBool,GetConfig,GetNoPinentry],GetConvSourceType->[GetString],SetUpdatePreferenceAuto->[SetUpdatePreferenceAuto,GetConfigWriter],WantsSystemd->[GetRunMode],GetTorProxy->[GetString,GetConfig,GetTorProxy],AllowPTrace->[GetBool,getEnvBool],GetUpdatePreferenceAuto->[GetUpdatePreferenceAuto,GetConfig],GetGregorPingInterval->[GetGregorPingInterval,GetConfig,getEnvDuration,GetDuration],GetUPAKCacheSize->[getEnvInt,GetConfig,GetInt],GetProofCacheLongDur->[GetConfig,getEnvDuration,GetDuration],GetProofCacheMediumDur->[GetConfig,getEnvDuration,GetDuration],SetUpdatePreferenceSkip->[SetUpdatePreferenceSkip,GetConfigWriter],GetServerURI->[GetString,GetConfig,GetServerURI,GetRunMode],GetProofCacheShortDur->[GetConfig,getEnvDuration,GetDuration],GetUsername->[GetConfig,GetUsername],GetRunModeAsString->[GetRunMode],GetProofCacheSize->[getEnvInt,GetConfig,GetInt],GetSocketBindFile->[GetString],GetSocketDialFiles->[defaultSocketFile,sandboxSocketFile],SetUpdatePreferenceSnoozeUntil->[SetUpdatePreferenceSnoozeUntil,GetConfigWriter],GetConfigFilename->[GetString,GetConfig,GetConfigDir,GetConfigFilename],GetAttachmentHTTPStartPort->[getEnvInt,GetConfig,GetInt],RememberPassphrase->[GetBool,GetConfig],GetDeviceIDForUID->[GetDeviceIDForUID,GetConfig],GetDeviceIDForUsername->[GetConfig,GetDeviceIDForUsername],SetUpdateLastChecked->[SetUpdateLastChecked,GetConfigWriter],GetDisplayRawUntrustedOutput->[GetDisplayRawUntrustedOutput,GetBool,GetConfig,getEnvBool],GetUseDefaultLogFile->[GetBool,getEnvBool],GetLocalTrackMaxAge->[GetLocalTrackMaxAge,GetConfig,getEnvDuration,GetDuration],GetUpdateDisabled->[GetConfig,GetUpdateDisabled],GetAvatarSource->[GetString],GetChatDbFilename->[GetDataDir,GetString,GetConfig,GetChatDbFilename],GetRuntimeDir->[GetString],GetUserCacheMaxAge->[GetUserCacheMaxAge,getEnvDuration,GetDuration,GetConfig],GetUID->[GetConfig,GetUID],GetBundledCA->[GetString,GetConfig,GetBundledCA],GetParamProofKitFilename->[GetString,GetConfig,GetParamProofKitFilename],GetAllowRoot->[GetBool,getEnvBool],getMobileSharedHomeFromCmdOrConfig->[GetString,GetConfig,GetMobileSharedHome],RunningInCI->[GetBool,getEnvBool],GetUpdaterConfigFilename->[GetUpdaterConfigFilename,GetString,GetConfig,GetConfigDir],GetUsernameForUID->[GetUsernameForUID,GetConfig],GetChatDelivererInterval->[GetChatDelivererInterval,getEnvDuration,GetDuration,GetConfig],GetTorHiddenAddress->[GetString,GetConfig,GetTorHiddenAddress],GetPinentry->[GetString,GetConfig,GetPinentry],GetLinkCacheCleanDur->[GetConfig,getEnvDuration,GetDuration],GetPidFile->[GetString,GetConfig,GetPidFile,GetInfoDir],GetLogFile->[GetString,GetLogFile],GetTorMode->[GetConfig,GetTorMode],GetUpdateURL->[GetConfig,GetUpdateURL],GetAPITimeout->[GetAPITimeout,GetConfig,getEnvDuration,GetDuration],GetDeviceID->[GetConfig,GetDeviceID],defaultSocketFile->[GetString,GetConfig,GetRuntimeDir,GetSocketFile],GetBGIdentifierDisabled->[GetBool,GetBGIdentifierDisabled,GetConfig],GetDoLogForward->[GetLocalRPCDebug],GetAPIDump->[GetBool,GetAPIDump,getEnvBool],GetAutoFork->[GetAutoFork,getEnvBool,GetNegBool,GetNoAutoFork,GetConfig],GetLabel->[GetString],GetSessionFilename->[GetString,GetSessionFilename,GetCacheDir,GetConfig],GetCodeSigningKIDs->[GetStringList,getEnvPath,GetCodeSigningKIDs,GetConfig,GetRunMode],GetEmailOrUsername->[GetEmail,GetUsername],GetGregorSaveInterval->[GetGregorSaveInterval,GetConfig,getEnvDuration,GetDuration],GetDisableTeamAuditor->[GetBool,GetConfig,getEnvBool],GetUpdatePreferenceSnoozeUntil->[GetConfig,GetUpdatePreferenceSnoozeUntil],GetVDebugSetting->[GetVDebugSetting,GetString,GetConfig],GetEmail->[GetString],GetReadDeletedSigChain->[GetBool,GetReadDeletedSigChain,GetConfig,getEnvBool],GetLocalRPCDebug->[GetString,GetConfig,GetLocalRPCDebug],GetRunMode->[GetConfig,GetRunMode],GetInboxSourceType->[GetString],GetMerkleKIDs->[GetStringList,GetMerkleKIDs,getEnvPath,GetConfig,GetRunMode],GetAppType->[GetConfig,GetAppType],GetDeviceCloneStateFilename->[GetString,GetConfig,GetDeviceCloneStateFilename,GetConfigDir],GetChatInboxSourceLocalizeThreads->[getEnvInt,GetConfig,GetInt],GetFeatureFlags->[GetFeatureFlags,GetConfig],GetStoredSecretAccessGroup->[GetBool,GetSecurityAccessGroupOverride,GetConfig],GetRunMode]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\ndo you need this or is it sufficient to just set the URI via env? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -294,6 +294,16 @@ type MasterConfig struct {\n \t// JenkinsPipelineConfig holds information about the default Jenkins template\n \t// used for JenkinsPipeline build strategy.\n \tJenkinsPipelineConfig JenkinsPipelineConfig\n+\n+\t// AuditConfig holds information related to auditing capabilities.\n+\tAuditConfig AuditConfig\n+}\n+\n+// AuditConfig holds configuration for the audit capabilities\n+type AuditConfig struct {\n+\t// If this flag is set, audit log will be printed in the logs.\n+\t// The logs contains, method, user and a requested URL.\n+\tEnabled bool\n }\n \n // JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy\n\nCallgraph: \t[StringKeySet,NewString]\nCodereview: ", "role": "user" }, { "content": "<think>\n...some explanation here...\n</think>\n\nLet's just call this `Enabled`. In the future we can add handler configs for the destinations (basic, files, events, etc) and keep this master flag for the on/off. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -67,6 +67,10 @@ type Config struct {\n \t// If not set, it uses all versions available.\n \t// Warning: This API should not be considered stable and will change soon.\n \tVersions []protocol.VersionNumber\n+\t// Ask the server to truncate the connection ID sent in the Public Header.\n+\t// This saves 8 bytes in the Public Header in every packet. However, if the IP address of the server changes, the connection cannot be migrated.\n+\t// Currently only valid for the client.\n+\tRequestConnectionIDTruncation bool\n }\n \n // A Listener for incoming QUIC connections\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" } ]
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
45