Showing 62 of 91 total issues
Method getMissingPermissions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private List<String> getMissingPermissions() {
List<String> manifestPermissions = new ArrayList<>();
if (Build.VERSION.SDK_INT < 23) {
return manifestPermissions;
- Create a ticketCreate a ticket
Method findCommonAspectRatios
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private TreeSet<AspectRatio> findCommonAspectRatios(List<Camera.Size> previewSizes, List<Camera.Size> pictureSizes) {
Set<AspectRatio> previewAspectRatios = new HashSet<>();
for (Camera.Size size : previewSizes) {
AspectRatio deviceRatio = AspectRatio.of(CameraKit.Internal.screenHeight, CameraKit.Internal.screenWidth);
AspectRatio previewRatio = AspectRatio.of(size.width, size.height);
- Create a ticketCreate a ticket
Method onMeasure
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mAdjustViewBounds) {
ViewGroup.LayoutParams layoutParams = getLayoutParams();
if (layoutParams.width == WRAP_CONTENT && layoutParams.height == WRAP_CONTENT) {
- Create a ticketCreate a ticket
Method onLayoutChange
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public void onLayoutChange(View view, int i, int i1, int i2, int i3, int i4, int i5, int i6, int i7) {
- Create a ticketCreate a ticket
Method apply
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void apply(JpegTransformer transformer) {
switch (orientation) {
case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:
transformer.flipHorizontal();
break;
- Create a ticketCreate a ticket
Method onMeasure
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mAdjustViewBounds) {
Size previewSize = getPreviewSize();
if (previewSize != null) {
- Create a ticketCreate a ticket
Method onRequestPermissionsResult
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == PERMISSION_REQUEST_CODE) {
int approvedPermissions = 0;
int deniedPermissions = 0;
- Read upRead up
- Create a ticketCreate a ticket
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
Method start
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void start() {
if (mIsStarted || !isEnabled()) {
// Already started, do nothing.
return;
}
- Read upRead up
- Create a ticketCreate a ticket
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
Method setFlash
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@Override
void setFlash(@Flash int flash) {
synchronized (mCameraLock) {
if (mCameraParameters != null) {
List<String> flashes = mCameraParameters.getSupportedFlashModes();
- Read upRead up
- Create a ticketCreate a ticket
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
Method onRequestPermissionsResult
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == PERMISSION_REQUEST_CODE) {
int approvedPermissions = 0;
int deniedPermissions = 0;
- Create a ticketCreate a ticket
Method open
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Synchronized
override fun open(facing: CameraFacing) {
cameraFacing = facing
val cameraId = cameraManager.getCameraId(facing) ?: throw RuntimeException()
val cameraCharacteristics = cameraManager.getCameraCharacteristics(cameraId)
- Create a ticketCreate a ticket
Method onOrientationChanged
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void onOrientationChanged(int orientation) {
if (orientation == OrientationEventListener.ORIENTATION_UNKNOWN || mDisplay == null) {
return;
}
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (parameters.getMaxNumFocusAreas() != 0 && focusMode != null &&
(focusMode.equals(Camera.Parameters.FOCUS_MODE_AUTO) ||
focusMode.equals(Camera.Parameters.FOCUS_MODE_MACRO) ||
focusMode.equals(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE) ||
focusMode.equals(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
- Create a ticketCreate a ticket
Method onLayout
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected void onLayout(boolean changed, int l, int t, int r, int b) {
- Create a ticketCreate a ticket
Method jniCropBitmap
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private native void jniCropBitmap(ByteBuffer handler, final int left, final int top, final int right, final int bottom);
- Create a ticketCreate a ticket
Method jniCrop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private native void jniCrop(ByteBuffer handler, int left, int top, int width, int height);
- Create a ticketCreate a ticket
Method requestPermissions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void requestPermissions(boolean requestCamera, boolean requestAudio) {
Activity activity = null;
Context context = getContext();
while (context instanceof ContextWrapper) {
if (context instanceof Activity) {
- Read upRead up
- Create a ticketCreate a ticket
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
Method setZoom
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
void setZoom(float zoomFactor) {
synchronized (mCameraLock) {
this.mZoom = zoomFactor;
if (zoomFactor <= 1) {
- Read upRead up
- Create a ticketCreate a ticket
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
Method getZoomForPercent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private int getZoomForPercent(int zoomPercent) {
List<Integer> zoomRatios = mCameraParameters.getZoomRatios();
int lowerIndex = -1;
int upperIndex = -1;
- Read upRead up
- Create a ticketCreate a ticket
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
Method setPreviewSize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void setPreviewSize(Size previewSize, int displayOrientation) {
if (mDisplayOrientation == 0 || mDisplayOrientation == 180) {
this.mPreviewSize = previewSize;
} else if ((displayOrientation == 90 || displayOrientation == 270) && (mDisplayOrientation != 90 && mDisplayOrientation != 270)) {
this.mPreviewSize = new Size(previewSize.getHeight(), previewSize.getWidth());
- Read upRead up
- Create a ticketCreate a ticket
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"