LarryHsiao/Nyx

View on GitHub

Showing 152 of 153 total issues

Method fire has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void fire() {
        final List<Tag> remoteUpdates = new ArrayList<>();
        final Map<Long, Tag> localTagMap = localTags
            .all()
Severity: Minor
Found in core/src/main/java/com/larryhsiao/nyx/core/sync/SyncTagsAction.java - 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

Method fire has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void fire() {
        final List<Metadata> remoteUpdates = new ArrayList<>();
        final Map<Long, Metadata> localMetadataMap = localMetadataSet.all()
            .stream()
Severity: Minor
Found in core/src/main/java/com/larryhsiao/nyx/core/sync/SyncMetadataAction.java - 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

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

    @Override
    public void sync() {
        try {
            if (isSyncing) {
                return;
Severity: Minor
Found in core/src/main/java/com/larryhsiao/nyx/core/sync/SyncImpl.java - 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

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

    private void updateRemotes(List<Jot> remoteUpdates) {
        final List<Future<?>> asyncFuture = new ArrayList<>();
        for (Jot remoteUpdate : remoteUpdates) {
            if (remoteUpdate.deleted()) {
                asyncFuture.add(
Severity: Minor
Found in core/src/main/java/com/larryhsiao/nyx/core/sync/SyncJotsAction.java - 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

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

    private long calculate(File file) {
        if (file.isDirectory()) {
            long result = 0;
            File[] files = file.listFiles();
            if (files == null) {
Severity: Minor
Found in app/src/main/java/com/larryhsiao/nyx/attachment/FileSize.java - 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

Method save has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
Open

    suspend fun save() = withContext(IO) {
        preferTags()
        val savedJot = nyx.jots().update(object : WrappedJot(jot.value ?: ConstJot()) {
            override fun content() = content.value ?: ""
            override fun title() = title.value ?: ""
Severity: Minor
Found in app/src/main/java/com/larryhsiao/nyx/jot/JotViewModel.kt - 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 method.
Open

            return ITEM_TYPE_VIDEO;
Severity: Major
Found in app/src/main/java/com/larryhsiao/nyx/attachment/AttachmentAdapter.java - About 30 mins to fix

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

        @Override
        public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
    
            if (requestCode == REQUEST_CODE_PICK_FILE && resultCode == RESULT_OK) {
    Severity: Minor
    Found in app/src/main/java/com/larryhsiao/nyx/attachment/AttachmentsFragment.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

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

        @Override
        public int getItemViewType(int position) {
            final Uri uri = data.get(position);
            final String mimeType = new UriMimeType(
                context,
    Severity: Minor
    Found in app/src/main/java/com/larryhsiao/nyx/attachment/AttachmentAdapter.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

    '}' at column 60 should be alone on a line.
    Open

        public StoredTokenSrc(Ceres ceres) {this.ceres = ceres;}

    Checks the placement of right curly braces ('}') for code blocks.This check supports if-else, try-catch-finally blocks, while-loops, for-loops,method definitions, class definitions, constructor definitions,instance, static initialization blocks, annotation definitions and enum definitions.For right curly brace of expression blocks of arrays, lambdas and class instancesplease follow issue#5945.For right curly brace of enum constant please follow issue#7519.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    '+' should be on a new line.
    Open

                "        function backToApp() {\n" +

    Parameter name 'e' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
    Open

                public void onError(Exception e) {

    Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

    To validate catch parameters please useCatchParameterName.

    To validate lambda parameters please useLambdaParameterName.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    First sentence of Javadoc is missing an ending period.
    Open

        /**

    Checks thatJavadoc summary sentence does not contain phrases that are not recommended to use.Summaries that contain only the {@inheritDoc} tag are skipped. Check alsoviolate Javadoc that does not contain first sentence.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    First sentence of Javadoc is missing an ending period.
    Open

    /**

    Checks thatJavadoc summary sentence does not contain phrases that are not recommended to use.Summaries that contain only the {@inheritDoc} tag are skipped. Check alsoviolate Javadoc that does not contain first sentence.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    '}' at column 45 should be alone on a line.
    Open

        public JotJson(Jot jot) {this.jot = jot;}

    Checks the placement of right curly braces ('}') for code blocks.This check supports if-else, try-catch-finally blocks, while-loops, for-loops,method definitions, class definitions, constructor definitions,instance, static initialization blocks, annotation definitions and enum definitions.For right curly brace of expression blocks of arrays, lambdas and class instancesplease follow issue#5945.For right curly brace of enum constant please follow issue#7519.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    '}' at column 57 should be alone on a line.
    Open

        public JsonMetadata(JsonObject obj) {this.obj = obj;}

    Checks the placement of right curly braces ('}') for code blocks.This check supports if-else, try-catch-finally blocks, while-loops, for-loops,method definitions, class definitions, constructor definitions,instance, static initialization blocks, annotation definitions and enum definitions.For right curly brace of expression blocks of arrays, lambdas and class instancesplease follow issue#5945.For right curly brace of enum constant please follow issue#7519.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    '+' should be on a new line.
    Open

                "<body>\n" +

    '+' should be on a new line.
    Open

                "        You are logged in.\n" +

    '+' should be on a new line.
    Open

                "        \n" +

    '+' should be on a new line.
    Open

                "    <!-- Define the button to \n" +
    Severity
    Category
    Status
    Source
    Language