FabrizioBrancati/BFKit-Swift

View on GitHub
Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift

Summary

Maintainability
F
4 days
Test Coverage

File UIImage+Extensions.swift has 560 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import CoreGraphics
import Foundation
import UIKit
#if canImport(CoreImage)
    import Accelerate
Severity: Major
Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 1 day to fix

    Function blur has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

            func blur(radius blurRadius: CGFloat, saturation: CGFloat = 1.8, tintColor: UIColor? = nil, maskImage: UIImage? = nil) -> UIImage {
                guard size.width > 1 && size.height > 1, let selfCGImage = cgImage else {
                    return self
                }
                
    Severity: Minor
    Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function blur has 90 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            func blur(radius blurRadius: CGFloat, saturation: CGFloat = 1.8, tintColor: UIColor? = nil, maskImage: UIImage? = nil) -> UIImage {
                guard size.width > 1 && size.height > 1, let selfCGImage = cgImage else {
                    return self
                }
                
    Severity: Major
    Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 3 hrs to fix

      Function scaleProportionally has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          func scaleProportionally(toSize targetSize: CGSize) -> UIImage {
              let sourceImage: UIImage = self
              let newTargetSize: CGSize = targetSize
      
              let imageSize: CGSize = sourceImage.size
      Severity: Minor
      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 1 hr to fix

        Function scaleProportionally has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            func scaleProportionally(toMinimumSize targetSize: CGSize) -> UIImage {
                let sourceImage: UIImage = self
                let newTargetSize: CGSize = targetSize
                
                let imageSize: CGSize = sourceImage.size
        Severity: Minor
        Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 1 hr to fix

          Function scaleProportionally has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              func scaleProportionally(toMaximumSize targetSize: CGSize) -> UIImage {
                  let newTargetSize: CGSize = targetSize
                  
                  if size.width > newTargetSize.width || newTargetSize.width == newTargetSize.height, size.width > size.height {
                      let factor: CGFloat = (newTargetSize.width * 100) / size.width
          Severity: Minor
          Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 1 hr to fix

            Function scaleProportionally has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                func scaleProportionally(toSize targetSize: CGSize) -> UIImage {
                    let sourceImage: UIImage = self
                    let newTargetSize: CGSize = targetSize
            
                    let imageSize: CGSize = sourceImage.size
            Severity: Minor
            Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function cmykHalftone has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    func cmykHalftone(center: CIVector, width: Float, angle: Float, sharpness: Float, gcr: Float, ucr: Float) -> UIImage { // swiftlint:disable:this function_parameter_count
            Severity: Minor
            Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 45 mins to fix

              Function scaleProportionally has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  func scaleProportionally(toMinimumSize targetSize: CGSize) -> UIImage {
                      let sourceImage: UIImage = self
                      let newTargetSize: CGSize = targetSize
                      
                      let imageSize: CGSize = sourceImage.size
              Severity: Minor
              Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Avoid too many return statements within this function.
              Open

                              return self
              Severity: Major
              Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return self
                Severity: Major
                Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return outputImage
                  Severity: Major
                  Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        return self
                    Severity: Major
                    Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 30 mins to fix

                      Function scaleProportionally has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          func scaleProportionally(toMaximumSize targetSize: CGSize) -> UIImage {
                              let newTargetSize: CGSize = targetSize
                              
                              if size.width > newTargetSize.width || newTargetSize.width == newTargetSize.height, size.width > size.height {
                                  let factor: CGFloat = (newTargetSize.width * 100) / size.width
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function should have complexity 10 or less: currently complexity equals 15
                      Open

                              func blur(radius blurRadius: CGFloat, saturation: CGFloat = 1.8, tintColor: UIColor? = nil, maskImage: UIImage? = nil) -> UIImage {

                      Function body should span 40 lines or less excluding comments and whitespace: currently spans 74 lines
                      Open

                              func blur(radius blurRadius: CGFloat, saturation: CGFloat = 1.8, tintColor: UIColor? = nil, maskImage: UIImage? = nil) -> UIImage {

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

                              if size.width > newTargetSize.width || newTargetSize.width == newTargetSize.height, size.width > size.height {
                                  let factor: CGFloat = (newTargetSize.width * 100) / size.width
                                  let newWidth: CGFloat = (size.width * factor) / 100
                                  let newHeight: CGFloat = (size.height * factor) / 100
                                  
                      Severity: Major
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 2 hrs to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 342..361

                      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 139.

                      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

                              } else if size.height > newTargetSize.height || newTargetSize.width == newTargetSize.height, size.width < size.height {
                                  let factor: CGFloat = (newTargetSize.width * 100) / size.height
                                  let newWidth: CGFloat = (size.width * factor) / 100
                                  let newHeight: CGFloat = (size.height * factor) / 100
                                  
                      Severity: Major
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 2 hrs to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 334..361

                      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 139.

                      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

                                  if widthFactor > heightFactor {
                                      thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5
                                  } else if widthFactor < heightFactor {
                                      thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5
                                  }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 55 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 406..410

                      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 67.

                      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

                                  if widthFactor < heightFactor {
                                      thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5
                                  } else if widthFactor > heightFactor {
                                      thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5
                                  }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 55 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 303..307

                      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 67.

                      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

                              func bumpDistortion(center: CIVector, radius: Float, scale: Float) -> UIImage {
                                  return filter(name: "CIBumpDistortion", parameters: [kCIInputCenterKey: center, kCIInputRadiusKey: radius, kCIInputScaleKey: scale])
                              }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 50 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 799..801

                      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 62.

                      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

                              func circularWrap(center: CIVector, radius: Float, angle: Float) -> UIImage {
                                  return filter(name: "CICircularWrap", parameters: [kCIInputCenterKey: center, kCIInputRadiusKey: radius, kCIInputAngleKey: angle])
                              }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 50 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 766..768

                      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 62.

                      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

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

                              guard let cgImage = cgImage, let context = CGContext(data: nil, width: Int(rect.width), height: Int(rect.height), bitsPerComponent: 8, bytesPerRow: 0, space: colorSpace, bitmapInfo: 0) else {
                                  return self
                              }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 50 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 623..625

                      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 58.

                      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

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

                              guard let cgImage = cgImage, let context = CGContext(data: nil, width: Int(rect.width), height: Int(rect.height), bitsPerComponent: 8, bytesPerRow: 0, space: colorSpace, bitmapInfo: 0) else {
                                  return self
                              }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 50 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 601..603

                      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 58.

                      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

                              func circleSplashDistortion(center: CIVector, radius: Float) -> UIImage {
                                  return filter(name: "CICircleSplashDistortion", parameters: [kCIInputCenterKey: center, kCIInputRadiusKey: radius])
                              }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 40 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 755..757

                      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 50.

                      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

                              func bloom(radius: Float, intensity: Float) -> UIImage {
                                  return filter(name: "CIBloom", parameters: [kCIInputRadiusKey: radius, kCIInputIntensityKey: intensity])
                              }
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 40 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 788..790

                      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 50.

                      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

                                      var effectInBuffer = vImage_Buffer(data: effectInContext.data, height: UInt(effectInContext.height), width: UInt(effectInContext.width), rowBytes: effectInContext.bytesPerRow)
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 30 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 862..862

                      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 42.

                      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

                                      var effectOutBuffer = vImage_Buffer(data: effectOutContext.data, height: UInt(effectOutContext.height), width: UInt(effectOutContext.width), rowBytes: effectOutContext.bytesPerRow)
                      Severity: Minor
                      Found in Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift and 1 other location - About 30 mins to fix
                      Sources/BFKit/Apple/UIKit/UIImage+Extensions.swift on lines 855..855

                      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 42.

                      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

                      There are no issues that match your filters.

                      Category
                      Status