|
1 | 1 | ---
|
2 |
| -title: Analyze your Source Code |
| 2 | +title: Performing Source Code Analysis |
3 | 3 | keywords: source, assessment, readiness, analyze, code, application
|
4 | 4 | last_updated: January, 2023
|
5 |
| -summary: "Use Tidal Tools source code analysis feature to measure your application code bases for cloud PaaS migration difficulty." |
| 5 | +summary: "Use Tidal Tools to analyze your application source code for cloud migration and modernization opportunities." |
6 | 6 | sidebar: main_sidebar
|
7 | 7 | permalink: analyze-source-code.html
|
8 | 8 | folder: tidaltools
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -## Tidal Analyze Source Code |
| 11 | +## Tidal Source Code Analysis |
12 | 12 |
|
13 |
| -Not sure how ready you are to move to the cloud? With Tidal you have |
14 |
| -the option to analyze your specified source code associated with the applications. |
15 |
| -The analysis will identify the difficulty to migrate your applications to the |
16 |
| -cloud. |
17 |
| - |
18 |
| -If you are interested in a deeper dive source code assessment, let us know at |
19 |
| -[info@tidalcloud.com](mailto:info@tidalcloud.com). |
20 |
| - |
21 |
| -Try it out! |
| 13 | +Not sure how ready you are to move to the cloud? With Tidal you can analyze your |
| 14 | +application's source code to identify difficulties and opportunities in migrating and modernizing. |
| 15 | +It is compatible with most of the current and legacy languages and detects a wide array of factors. See [the overview |
| 16 | +for more information on its capabilities](/code-analysis-overview.html). |
22 | 17 |
|
23 | 18 | {% include image.html file="source_code_analyze.png" caption="Analyze your source code" %}
|
24 | 19 |
|
25 |
| -## Getting Started |
| 20 | +## What You Need to Get Started |
26 | 21 |
|
27 |
| -1. Install, configure and authenticate via Tidal Tools. Make sure you follow these guides. |
| 22 | +1. [Install](tidal-tools.html#install), and [authenticate](tidal-tools.html#connecting-to-the-api) Tidal Tools with your [Tidal Accelerator](tidalcloud.com/accelerator) Workspace. |
28 | 23 |
|
29 |
| -- How to [install](tidal-tools.html#install) Tidal Tools. |
30 |
| -- Install Tidal Tools [dependencies](tidal-tools.html#dependencies). |
31 |
| -- Make sure you can [connect](tidal-tools.html#connecting-to-the-api) with your workspace using Tidal Tools. |
32 |
| -- As the last step, You should run the [tidal doctor](troubleshooting.html#tidal-doctor) command to verify that your environment has been configured properly. |
| 24 | +2. You will need the ID of the application you are going to perform the source code analysis on. You can find it in the URL bar when looking at an application in Accelerator. ex. If you are viewing an application in Tidal, the URL will show `https://[your workspace].tidal.cloud/apps/111/overview` in this case 111 is the application ID. |
33 | 25 |
|
34 |
| -2. You will need the ID of the application for which you are going to perform the source code analysis. You can find it in the URL bar when looking at an application. ex. If you are viewing an application in Tidal, the URL will show `https://[your workspace].tidal.cloud/apps/111/overview` in this case 111 is the application ID. |
| 26 | +3. You will need a copy of the source code files for the application locally on your device. |
35 | 27 |
|
36 |
| -3. Lastly, you will need a local copy of the source code for the application. |
| 28 | +With that, you can perform the code analysis in a matter of seconds. |
37 | 29 |
|
38 |
| -4. Perform the Source Code Analysis. There are 2 options to do so. You can find more details in this [section](#perform-the-analysis). |
| 30 | +{% include tip.html content="Looking to try it out and don't have any code handy? You can use this sample ['schoolbus' application](https://github.com/tidalmigrations/schoolbus) by [cloning it from GitHub](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)." %} |
39 | 31 |
|
40 |
| -That is all. You should be able to see the results in your workspace within seconds. |
| 32 | +## Performing the Code Analysis |
41 | 33 |
|
42 |
| -{% include tip.html content="Looking to try it out and don't have any code handy? You can use this sample [schoolbus application](https://github.com/tidalmigrations/schoolbus) by [cloning it from GitHub](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)." %} |
| 34 | +When analyzing an application there are two workflows available. Deciding which option to use depends if the code you are analyzing is located on a machine that has access to the internet or not, specifically https://tidal.cloud. If you do have the code on a machine with this access you can use the standard mode. If the code is located on a device that can not access the Accelerator platform, then you can use the Offline mode. |
43 | 35 |
|
44 |
| -## Perform the analysis |
| 36 | +### Standard mode |
45 | 37 |
|
46 |
| -When analyzing a source code (or multiple), you have two options. |
47 |
| - |
48 |
| -1. Perform the source code analysis and upload the result immediately to your workspace. This is Tidal Tools' default behaviour. To do so, all you need to do is run the following command. |
| 38 | +1. Perform the source code analysis and upload the result immediately to your workspace: |
49 | 39 |
|
50 | 40 | ```bash
|
51 | 41 | cd /path/to/source-code
|
52 | 42 | tidal analyze code --app-id [app_id_for_your_application]
|
53 | 43 | ```
|
54 | 44 |
|
55 |
| - Alternatively, you can pass multiple locations or even wildcard for analysis. You can even specify individual files. |
| 45 | + Alternatively, you can pass multiple locations or even wildcard paths, or filenames for analysis. This will result in all the provided and matching file paths to be considered source code for the one application you are analyzing. |
56 | 46 |
|
57 | 47 | ```bash
|
58 | 48 | tidal analyze code [/path/to/source-code-A] [/path/to/source-code-B] --app-id [app_id_for_your_application]
|
59 | 49 | ```
|
60 | 50 |
|
61 |
| -2. Perform the source code analysis and upload the results **at a later time**. The following section will explain how to run database analysis in **offline mode** |
62 |
| - |
63 |
| -### Running offline |
| 51 | +### Offline mode |
64 | 52 |
|
65 |
| -There are circumstances in which you need to perform a source code analysis on an environment without or with restricted internet access. In such case, you can perform the analysis, capture its results and at a later stage upload those results to your Tidal workspace. |
| 53 | +If the machine running code analysis can not access the internet; you can perform the analysis and store the results locally and upload those results to your workspace from a different machine. This process will involve two machines, one that has internet access and one that has no internet access, and a copy of the application's source code. |
66 | 54 |
|
67 |
| -These are the steps you need to follow in order to bypass internet access limitations: |
| 55 | +1. On a machine with internet access, [install, and configure Tidal Tools](#what-you-need-to-get-started). |
68 | 56 |
|
69 |
| -1. On a Machine with internet access, you need to install, and configure Tidal Tools. |
70 |
| - |
71 |
| -2. Package Tidal Tools and its required docker container images into a tar file. This will allow you to move the archive file into your restricted environment. To do so, run the following command. |
| 57 | +2. Backup Tidal Tools required dependencies into a backup file. |
72 | 58 |
|
73 | 59 | `tidal backup`
|
74 | 60 |
|
75 |
| - Once it has finished, you will find (in your current location) a tar file called `tidal-snapshot_DATE.tar`. This is the file you need to transport into your internet restricted environment. |
| 61 | + When finished in the current working directory there will be a file called `tidal-snapshot_DATE.tar`. Move this file, in any reasonable way you can, to the machine with the code on it to be analyzed |
76 | 62 |
|
77 |
| -3. On the machine that has no internet access, you will now restore Tidal Tools using the following command. |
| 63 | +3. On the machine that has no internet access, you will now restore the backup: |
78 | 64 |
|
79 | 65 | `tidal restore tidal-snapshot_DATE.tar`
|
80 | 66 |
|
81 |
| - This will load a docker image and all the existing Tidal Tools configurations from the original machine. |
| 67 | + This will load the needed dependencies and Tidal Tools configuration needed to run the analysis. |
82 | 68 |
|
83 |
| -4. You can now run the source code analysis without any external network connectivity. |
| 69 | +4. Now run the source code analysis on the current directory: |
84 | 70 |
|
85 | 71 | ```bash
|
86 | 72 | cd /path/to/source-code
|
87 | 73 | tidal analyze code --offline
|
88 |
| - ``` |
| 74 | + ``` |
89 | 75 |
|
90 |
| - Alternatively, you can pass multiple locations or even wildcard for analysis. You can even specify individual files. |
| 76 | + Alternatively, you can pass multiple locations or even wildcard paths, or filenames for analysis. This will result in all the provided and matching file paths to be considered source code for the one application you are analyzing. |
91 | 77 |
|
92 | 78 | ```bash
|
93 | 79 | tidal analyze code [/path/to/source-code-A] [/path/to/source-code-B] --offline
|
94 | 80 | ```
|
95 | 81 |
|
96 |
| - Note: |
| 82 | + The `--offline` flag indicates that the results are outputted to a local file, instead of being uploaded. |
| 83 | + |
| 84 | + After the analysis is completed, you will find the results in a file called `code-analysis-<DATE>-<TYPE>.json`. |
97 | 85 |
|
98 |
| - - The `--offline` flag indicates to Tidal Tools that the output needs to be stored in a file instead of being uploaded. |
99 | 86 |
|
100 |
| - After the analysis is completed, you will find an artifact file called `code-analysis-<DATE>-<TYPE>.json` that can then be transferred into a machine with internet connectivity. |
| 87 | +5. Transfer the results file from the analysis to the machine with internet access. |
101 | 88 |
|
102 |
| -5. Back to the machine with internet access, you can now upload your results to your workspace with this command. |
| 89 | +5. On the machine with internet access, upload the results to your workspace: |
103 | 90 |
|
104 | 91 |
|
105 | 92 | ```bash
|
106 | 93 | tidal analyze code upload [file_name] --app-id [app_id_for_your_application]`
|
107 | 94 | ```
|
108 | 95 |
|
109 |
| - You should receive confirmation that the upload has been completed and can navigate to Tidal to see the results. |
| 96 | + You should receive confirmation that the upload has been completed and can navigate to Tidal Accelerator to see the results. |
110 | 97 |
|
111 |
| -{% include tip.html content="Need to run code analysis on a entire set of applications all from one machine? Run [this command and easily create a directory for every application already in Tidal Accelerator](https://github.com/tidalmigrations/gists/blob/master/make_source_code_dirs.sh)" %} |
| 98 | +{% include tip.html content="Need to run code analysis on an entire set of applications all from one machine? Run [this command and easily create a directory for every application already in your Tidal Accelerator workspace](https://github.com/tidalmigrations/gists/blob/master/make_source_code_dirs.sh)." %} |
112 | 99 |
|
113 | 100 | ### Why Docker?
|
114 | 101 |
|
115 |
| -You need to install Docker in order to complete the source code analysis. This is because the analysis uses several system dependent software libraries. |
| 102 | +You need to install Docker to complete the source code analysis. This is because the analysis uses several system-dependent software libraries. |
116 | 103 | By using Docker, the analysis can use those libraries without requiring you to install any other dependencies.
|
117 | 104 |
|
118 | 105 | ### What about security?
|
119 | 106 |
|
120 |
| -The entire analysis takes place _locally on your machine_. The **only** data that is captured and sent from the analysis are the results of the analysis and metadata. **No source code, files or the contents of any files on your machine are ever copied or sent anywhere.** |
| 107 | +**The entire code analysis process takes place locally on your machine.** It will scan your files locally looking for common patterns and information when modernizing. The only data that is captured and sent from the analysis are the results of the analysis and the associated metadata. You can view all of the raw analysis results that are sent to Tidal Accelerator before they are sent, by viewing the contents of the results file locally. |
0 commit comments