davidmigloz/go-bees

View on GitHub

Showing 100 of 387 total issues

Method getRecording has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void getRecording(long apiaryId, long hiveId, Date start, Date end,
                             @NonNull GetRecordingCallback callback) {

    Method saveApiary has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private void saveApiary(long apiaryId, String name, Double latitude, Double longitude,
                                String notes) {

      Method generateWeatherData has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private void generateWeatherData(Apiary apiary, Date date,
                                           double[] temp, double[] rain, double[] wind) {

        Method setTime has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static Date setTime(final Date date,
                                       final int hour, final int min, final int sec, final int msec) {
        Severity: Minor
        Found in app/src/main/java/com/davidmiguel/gobees/utils/DateTimeUtils.java - About 35 mins to fix

          Method getRecording has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public void getRecording(long apiaryId, long hiveId, Date start, Date end,
                                       @NonNull GetRecordingCallback callback) {

            Method compare has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                public int compare(Camera.Size size1, Camera.Size size2) {
                    // Check nulls
                    if (size1 == null && size2 == null) {
                        return 0;

            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

                public void setZoom(int ratio) {
                    if (params.isZoomSupported()) {
                        // Get supported ratios
                        List<Integer> zoomRatios = params.getZoomRatios();
                        // Chose closest ratio

            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 method.
            Open

                        return -1;

              Avoid too many return statements within this method.
              Open

                          return 1;

                Method save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public void save(String name, String latitude, String longitude, String notes) {
                        Double lat = null;
                        Double lon = null;
                        // Check name not empty

                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 setZoomRatio has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void setZoomRatio(Camera camera, int zoomRatio) {
                        Camera.Parameters params = camera.getParameters();
                        if (params.isZoomSupported()) {
                            // Get supported ratios
                            List<Integer> zoomRatios = params.getZoomRatios();

                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 show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function show(type)
                {
                    count = 0;
                    for (var key in methods) {
                        var row = document.getElementById(key);
                Severity: Minor
                Found in docs/javadoc/script.js - 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

                Method getHiveWithRecordings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public void getHiveWithRecordings(long hiveId, @NonNull GetHiveCallback callback) {
                        try {
                            // Get hive
                            Hive hive = realm.where(Hive.class).equalTo(ID, hiveId).findFirst();

                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 onStartCommand has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public int onStartCommand(Intent intent, int flags, int startId) {
                        super.onStartCommand(intent, flags, startId);
                
                        // START action

                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 process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public Mat process(@NonNull Mat frame) {
                        if (frame.empty()) {
                            Log.e("Invalid input frame.");
                            return null;

                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 getCamera has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private Camera getCamera(int facing) {
                        Camera cam = null;
                        CameraInfo cameraInfo = new CameraInfo();
                        int cameraCount = Camera.getNumberOfCameras();
                        for (int camIndex = 0; camIndex < cameraCount; camIndex++) {

                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 updatePreference has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void updatePreference(Preference preference, Object value) {
                        // Get value if not passed
                        Object newVal;
                        if (value == null) {
                            if (preference instanceof VNTNumberPickerPreference) {

                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 setupTempChart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void setupTempChart(List<MeteoRecord> meteo) {
                        // Setup data
                        List<Entry> entries = new ArrayList<>();
                        // Add as first entry a copy of the first temperature record
                        // First relative timestamp is 0

                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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    protected void onCreate(Bundle savedInstanceState) {
                        super.onCreate(savedInstanceState);
                        setContentView(R.layout.recording_act);
                

                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 setUpToolbar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static ActionBar setUpToolbar(AppCompatActivity act, boolean isHome, int title) {
                        Toolbar toolbar = (Toolbar) act.findViewById(R.id.toolbar);
                        act.setSupportActionBar(toolbar);
                        ActionBar ab = act.getSupportActionBar();
                        if (ab != null) {
                Severity: Minor
                Found in app/src/main/java/com/davidmiguel/gobees/utils/AndroidUtils.java - 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

                Severity
                Category
                Status
                Source
                Language