lynrin/cordova-plugin-buildinfo

View on GitHub

Showing 6 of 13 total issues

Function init has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    init: function (successCallback, errorCallback, args) {
        var self = BuildInfoProxy;

        if (null !== self._cache) {
            successCallback(self._cache);
Severity: Major
Found in src/windows/BuildInfoProxy.js - About 3 hrs to fix

    Method init has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void init(String buildConfigClassName, CallbackContext callbackContext) {
            // Cached check
            if (null != mBuildInfoCache) {
                callbackContext.success(mBuildInfoCache);
                return;
    Severity: Major
    Found in src/android/BuildInfo.java - About 2 hrs to fix

      Function installWindows has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function installWindows(windowsPath) {
      
          const targetPath = path.join(windowsPath, 'CordovaApp.projitems');
          let projitems = fs.readFileSync(targetPath).toString();
          let changed = false;
      Severity: Minor
      Found in scripts/after_install.js - About 1 hr to fix

        Function init has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            init: function (successCallback, errorCallback, args) {
                var self = BuildInfoProxy;
        
                if (null !== self._cache) {
                    successCallback(self._cache);
        Severity: Minor
        Found in src/windows/BuildInfoProxy.js - About 1 hr 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 init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private void init(String buildConfigClassName, CallbackContext callbackContext) {
                // Cached check
                if (null != mBuildInfoCache) {
                    callbackContext.success(mBuildInfoCache);
                    return;
        Severity: Minor
        Found in src/android/BuildInfo.java - About 1 hr 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 rewriteBuildInfoProxy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function rewriteBuildInfoProxy(context, pathPrefix) {
        
            const opts = context.opts || {};
            const options = opts.options || {};
            const release = options.release || false;
        Severity: Minor
        Found in scripts/browser_after_prepare.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language