Showing 62 of 91 total issues
File Camera1.java
has 921 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.wonderkiln.camerakit;
import android.graphics.Rect;
import android.graphics.YuvImage;
import android.hardware.Camera;
- Create a ticketCreate a ticket
File CameraKitView.java
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.camerakit;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
- Create a ticketCreate a ticket
CameraKitView
has 66 methods (exceeds 20 allowed). Consider refactoring. Open
public class CameraKitView extends GestureLayout {
/**
* Request code for a runtime permissions intent.
*/
- Create a ticketCreate a ticket
Camera1
has 56 methods (exceeds 20 allowed). Consider refactoring. Open
@SuppressWarnings("deprecation")
public class Camera1 extends CameraImpl {
private static final String TAG = Camera1.class.getSimpleName();
- Create a ticketCreate a ticket
CameraView
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
public class CameraView extends CameraViewLayout {
private static Handler sWorkerHandler;
static {
- Create a ticketCreate a ticket
File CameraView.java
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.wonderkiln.camerakit;
import static com.wonderkiln.camerakit.CameraKit.Constants.FACING_BACK;
import static com.wonderkiln.camerakit.CameraKit.Constants.FACING_FRONT;
import static com.wonderkiln.camerakit.CameraKit.Constants.FLASH_AUTO;
- Create a ticketCreate a ticket
Method onStart
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public void onStart() {
if (isInEditMode()) {
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 getCameraPreviewResolution
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Size getCameraPreviewResolution() {
if (mPreviewSize == null && mCameraParameters != null) {
TreeSet<Size> sizes = new TreeSet<>();
for (Camera.Size size : mCameraParameters.getSupportedPreviewSizes()) {
sizes.add(new Size(size.width, size.height));
- 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 getCamcorderProfile
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private CamcorderProfile getCamcorderProfile(@VideoQuality int videoQuality) {
CamcorderProfile camcorderProfile = null;
switch (videoQuality) {
case CameraKit.Constants.VIDEO_QUALITY_QVGA:
if (CamcorderProfile.hasProfile(mCameraId, CamcorderProfile.QUALITY_QVGA)) {
- 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
BitmapOperator
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
public class BitmapOperator {
private ByteBuffer handler;
private BitmapOperator() {
- Create a ticketCreate a ticket
Method setFocus
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
@Override
void setFocus(@Focus int focus) {
synchronized (mCameraLock) {
this.mFocus = focus;
switch (focus) {
- 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
CameraImpl
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
abstract class CameraImpl {
protected final EventDispatcher mEventDispatcher;
protected final PreviewImpl mPreview;
- Create a ticketCreate a ticket
Method obtainAttributes
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void obtainAttributes(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CameraKitView);
mAdjustViewBounds = a.getBoolean(R.styleable.CameraKitView_android_adjustViewBounds, false);
mAspectRatio = a.getFloat(R.styleable.CameraKitView_camera_aspectRatio, -1f);
- Create a ticketCreate a ticket
File Camera2.kt
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.camerakit.api.camera2
import android.content.Context
import android.content.Context.CAMERA_SERVICE
import android.graphics.ImageFormat
- Create a ticketCreate a ticket
MainActivity
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
public class MainActivity extends AppCompatActivity implements Toolbar.OnMenuItemClickListener {
private CameraKitView cameraView;
private Toolbar toolbar;
- Create a ticketCreate a ticket
Method setFocusArea
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
@Override
void setFocusArea(float x, float y) {
synchronized (mCameraLock) {
if (mCamera != null) {
Camera.Parameters parameters = getCameraParameters();
- 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 onCreate
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- Create a ticketCreate a ticket
Method adjustCameraParameters
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void adjustCameraParameters(int currentTry) {
boolean haveToReadjust = false;
Camera.Parameters resolutionLess = mCamera.getParameters();
if (getPreviewResolution() != null) {
- Create a ticketCreate a ticket
Method captureImage
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
void captureImage(final ImageCapturedCallback callback) {
switch (mMethod) {
case METHOD_STANDARD:
synchronized (mCameraLock) {
- Create a ticketCreate a ticket
Method onMeasure
has a Cognitive Complexity of 17 (exceeds 5 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) {
- 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"