cs-util-com/cscore

View on GitHub

Showing 1,140 of 1,140 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        private static MyModel MyReducer(MyModel previousState, object action) {
            bool modelChanged = false;
            var users = previousState.MutateField(previousState.users, action, ReduceUsers, ref modelChanged);
            var selectedUser = previousState.MutateField(previousState.currentlySelectedUser, action, ReduceSelection, ref modelChanged);
            if (modelChanged) { return new MyModel(selectedUser, users); }
CsCore/UnityTests/Assets/Plugins/CsCoreUnityDemoScenes/Ui24_7GUIsBechnmark/Task6_CircleDrawer/Task6_CircleDrawer.cs on lines 187..193

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 108.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        public void SetElementColor(int elementIndex, ref Color startColor, ref Color endColor)
        {
            var offset = elementIndex * 4;
            m_Colors[offset] = startColor;
            m_Colors[offset + 1] = m_Colors[offset];
CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/rendering/lines/Runtime/XRMeshChain.cs on lines 340..347

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        private static double[] AddArrays(double[] array1, double[] array2) {
            if (array1 == null || array2 == null) { throw new ArgumentException("Input arrays cannot be null."); }
            if (array1.Length != array2.Length) { throw new ArgumentException("Input arrays must have the same length."); }
            return array1.Zip(array2, (x, y) => x + y).ToArray();
        }
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/algorithms/images/GuidedFilter.cs on lines 259..264
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/algorithms/images/GuidedFilter.cs on lines 271..275

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        public void SetElementColor32(int elementIndex, ref Color32 startColor, ref Color32 endColor)
        {
            var offset = elementIndex * 4;
            m_Colors[offset] = startColor;
            m_Colors[offset + 1] = m_Colors[offset];
CsCore/CsCoreUnity/Plugins/CsCoreUnity/com/csutil/rendering/lines/Runtime/XRMeshChain.cs on lines 325..332

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        private void InitDebouncedDownloadLogic() {
            latestRawSheetData = null;
            // Create a debounced func that only downloads new data max every 10 seconds and
            // trigger this method only if inet available:
            Func<Task> t = async () => {
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/datastructures/keyvaluestore/GoogleSheetsKeyValueStoreV2.cs on lines 27..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        private static double[] MultArrays(double[] array1, double[] array2) {
            if (array1 == null || array2 == null) { throw new ArgumentException("Input arrays cannot be null."); }
            if (array1.Length != array2.Length) { throw new ArgumentException("Input arrays must have the same length."); }

            return array1.Zip(array2, (x, y) => x * y).ToArray();
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/algorithms/images/GuidedFilter.cs on lines 271..275
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/algorithms/images/GuidedFilter.cs on lines 277..281

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        private static double[] SubArrays(double[] array1, double[] array2) {
            if (array1 == null || array2 == null) { throw new ArgumentException("Input arrays cannot be null."); }
            if (array1.Length != array2.Length) { throw new ArgumentException("Input arrays must have the same length."); }
            return array1.Zip(array2, (x, y) => x - y).ToArray();
        }
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/algorithms/images/GuidedFilter.cs on lines 259..264
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/algorithms/images/GuidedFilter.cs on lines 277..281

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        private void InitDebouncedDownloadLogic() {
            sheetData = null;
            // Create a debounced func that only downloads new data max every 10 seconds and
            // trigger this method only if inet available:
            Func<Task> t = async () => {
CsCore/PlainNetClassLib/src/Plugins/CsCore/com/csutil/datastructures/keyvaluestore/GoogleSheetsKeyValueStore.cs on lines 42..56

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method ReloadData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public void ReloadData(bool isReset = false) {
            if (rectTransform == null) {
                rectTransform = GetComponent<RectTransform>();
            }
            if (scrollRect == null) {

    Method MaterialChanged has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            static void MaterialChanged(Material material)
            {
                var worldDataMode = false;
                var depthScaleMode = true;
                if (material.HasProperty("_WorldData"))

      Method Drop has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public void Drop(CollectionPage col)
              {
                  // add all pages to delete
                  var pages = new HashSet<uint>();
      
      

        Method Delete has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public int Delete(string collection, Query query)
                {
                    if (collection.IsNullOrWhiteSpace()) throw new ArgumentNullException(nameof(collection));
                    if (query == null) throw new ArgumentNullException(nameof(query));
        
        

          Method Update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public DataBlock Update(CollectionPage col, PageAddress blockAddress, byte[] data)
                  {
                      // get datapage and mark as dirty
                      var dataPage = _pager.GetPage<DataPage>(blockAddress.PageID);
                      var block = dataPage.GetBlock(blockAddress.Index);

            Method ReadNumber has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private string ReadNumber(ref bool dbl)
                    {
                        var sb = new StringBuilder();
                        sb.Append(_char);
            
            

              Method Dispose has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          public void Dispose()
                          {
              #if DEBUG
                              Debug.Assert(!_disposed);
                              _disposed = true;

                Method stbi__decode_jpeg_header has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private bool stbi__decode_jpeg_header(int scan)
                        {
                            var m = 0;
                            jfif = 0;
                            app14_color_transform = -1;

                  Method SendAsync has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public async Task<HttpResponseMessage> SendAsync(HttpMethod method) {
                  
                              if (handler == null) {
                                  handler = new HttpClientHandler() {
                                      AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate

                    Method ValidateAndEscapeDelimiters has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            private void ValidateAndEscapeDelimiters()
                            {
                                if (m_Delimiters == null)
                                    throw new ArgumentException("", nameof(Delimiters)); //GetArgumentExceptionWithArgName["Delimiters", ResID.MyID.TextFieldParser_DelimitersNothing, "Delimiters"];
                    
                    

                      Method RunTest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public override IEnumerator RunTest() {
                      
                                  var map = gameObject.GetLinkMap();
                      
                                  // A minimalistic simple example to show an action menu:

                        Method TestDataStoreTransitiveChanges has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Fact]
                                public static void TestDataStoreTransitiveChanges() {
                        
                                    CellsModel model = new CellsModel(ImmutableDictionary<CellPos, Cell>.Empty);
                                    var store = new DataStore<CellsModel>(CellsReducers.MainReducer, model, Middlewares.NewLoggingMiddleware<CellsModel>());
                          Severity
                          Category
                          Status
                          Source
                          Language